Giter Club home page Giter Club logo

Comments (8)

ahmad-moussawi avatar ahmad-moussawi commented on May 25, 2024

Hi thanks for your feedback, yes this already mentioned in #13, it will get fixed this weekend hopefully :)

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on May 25, 2024

Closing it, since fixed on the https://www.nuget.org/packages/SqlKata/1.0.0-beta-354 package

from querybuilder.

sbur74 avatar sbur74 commented on May 25, 2024

Hi, I have testet the Solution and it works fine, but why do you not use OFFSET FETCH NEXT, like this:
"SELECT * FROM [dbo].[Products] ORDER BY ProductID ASC OFFSET @offset ROWS FETCH NEXT @next ROW ONLY"

Maybe you get a Performance issue with your Solution.

tanks

sascha

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on May 25, 2024

@sbur74, because this will not work on the old version of SqlServer <2012, maybe we can add a new compiler to target the modern SqlServer engines

from querybuilder.

sbur74 avatar sbur74 commented on May 25, 2024

@ahmad-moussawi:
Hi, thanks a lot for you explanation, is it possible to write an extension for is or is it necessary to write a completely new compiler?

tanks and regards

sascha

from querybuilder.

ahmad-moussawi avatar ahmad-moussawi commented on May 25, 2024

@sbur74 yes you should write a new compiler for this, one way to do this, is to extend the current SqlServerCompiler class and override the following methods OnBeforeSelect, CompileColumns, CompileLimit and CompileOffset, check https://github.com/sqlkata/querybuilder/blob/master/QueryBuilder/Compilers/SqlServerCompiler.cs#L24-L135, we would be happy if you contribute back to this project :)

from querybuilder.

sbur74 avatar sbur74 commented on May 25, 2024

@ahmad-moussawi: thanks a lot for you invention.
I'll try my best to make a running complier.

from querybuilder.

xgwssab avatar xgwssab commented on May 25, 2024

@ahmad-moussawi : i have to place this "OFFSET {0} ROWS FETCH NEXT {1} ROWS ONLY" clause after ORDER BY

I thought i'll could do this with a RawCondition:
query.Clauses.Insert(query.Clauses.Count, new RawCondition
{
Component = "",
Engine = EngineCode,
Bindings = new object[] { limitOffset.Offset, limitOffset.Limit },
Expression = "OFFSET {0} ROWS FETCH NEXT {1} ROWS ONLY"
});

but this has no impact on the SqlResult.
any idea why this could be?

from querybuilder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.