Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit not being compiled #561

Closed
gaurangfgupta opened this issue Mar 23, 2022 · 1 comment
Closed

Limit not being compiled #561

gaurangfgupta opened this issue Mar 23, 2022 · 1 comment

Comments

@gaurangfgupta
Copy link

gaurangfgupta commented Mar 23, 2022

Issue

I'm using SqlKata only to compile. The limit value is not being compiled correctly.
When I run the following query and compile, like:

var query = new Query("GB").Limit(50);

SqlServerCompiler _sqlCompiler = new SqlServerCompiler();
var sqlResult = _sqlCompiler.Compile(query);
return sqlResult.Sql;

the compiled SqlResult.Sql is SELECT TOP (@p0) * FROM [GB]
whereas SqlResult.ToString() is SELECT TOP (50) * FROM [GB]

However, the documentation at https://sqlkata.com/docs/#compile-only-example states "Warning: Don't ever use SqlResult.ToString() to execute your queries."

@ahmad-moussawi
Copy link
Contributor

This is not an issue, this is by design, if you want to execute the queries by yourself and not use the execution package, you have to use the SqlResult.Bindings to get the params value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants