Comments (5)
Fantastic! you see, I feel the queries so much more readable once written using SqlKata chaining methods, and then only converted to raw SQL to be fed into an ORM.
TY!
from querybuilder.
You're right. Is there any other way to compile query?
If you are not the SqlKata.Execution package, you should use the SqlResult
class to get the SQL string with the parameters bindings.
See https://github.com/sqlkata/querybuilder/blob/master/SqlKata.Execution/QueryFactory.cs#L77 as an example
from querybuilder.
Yes, you can. package contains compilers for every database it supports, under SqlKata.Compilers
namespace.
you can use Compile
method to get SqlResult
which contains Sql
and RawSql
properties. if you want to get Sql parsed with actually passed parameters call ToString()
method on SqlResult
.
Example with postgres;
var query = new Query();
var compiler = new PostgresCompiler();
var sqlResult = compiler.Compile(query);
var sql = sqlResult.ToString();
from querybuilder.
It is worth noting that the ToString()
method is meant only for debugging purposes and not for executing queries.
Check https://sqlkata.com/docs#compile-only-example
from querybuilder.
You're right. Is there any other way to compile query?
from querybuilder.
Related Issues (20)
- Oracle connection pooling with SqlKata
- Can you please include https://github.com/sqlkata/querybuilder/commit/f3d7c924f4d11c33056d7b002f9d5066dc856117 & re-publish 2.4.0 ?
- 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
- 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 ?
- `With` missing if defined in sub query HOT 2
- Use RetryProvider in SqlKata.Execution
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.