Comments (8)
Hi thanks for your feedback, yes this already mentioned in #13, it will get fixed this weekend hopefully :)
from querybuilder.
Closing it, since fixed on the https://www.nuget.org/packages/SqlKata/1.0.0-beta-354 package
from querybuilder.
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.
@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.
@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.
@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.
@ahmad-moussawi: thanks a lot for you invention.
I'll try my best to make a running complier.
from querybuilder.
@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)
- RobiniaDocs API Explorer
- Compile query with parameters for ODBC Connection
- Assigning NULL value to column with AsUpdate throws NotSupportedException HOT 1
- db access where day error No value given for one or more required parameters.
- [SQLServer] insert bool value #437 HOT 1
- Possible documentation error
- Distinct AsCount error
- Vulnerability in System.Text.RegularExpressions 4.3.0
- FromRaw can't translate list type parameter properly HOT 1
- how to use include HOT 2
- Question: Combining multiple Statements HOT 1
- Error on WhereContains HOT 1
- Getting Raw SQL from the package, without passing it to the database engine HOT 5
- Error when trying to insert into Always Encrypted column
- SqlServerCompiler Limit generates different query on compile compared to previous versions HOT 3
- Postgres over-escaping ? HOT 1
- `With` missing if defined in sub query HOT 2
- Use RetryProvider in SqlKata.Execution
- [Ignore] atbt discerning Insert/Update
- Next release, 3.0.0 from 2022 year is still beta.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from querybuilder.