| Option | Possible values | Optional | Info |
|---|---|---|---|
| overrideDriverVersion | default:2.3.6 for MySqlConnector (mysql)8.0.3 for Npgsql (postgresql)8.0.10 for Microsoft.Data.Sqlite (sqlite)values: The desired driver version |
Yes | Allows you to override the version of DB driver to be used. |
| targetFramework | default: net8.0values: netstandard2.0, netstandard2.1, net8.0 |
Yes | Determines the target framework for your generated code, meaning the generated code will be compiled to the specified runtime. For more information and help deciding on the right value, refer to the Microsoft .NET Standard documentation. |
| generateCsproj | default: truevalues: false,true |
Yes | Assists you with the integration of SQLC and csharp by generating a .csproj file. This converts the generated output to a .dll, a project that you can easily incorporate into your build process. |
| namespaceName | default: the generated project name | Yes | Allows you to override the namespace name to be different than the project name |
| useDapper | default: falsevalues: false,true |
Yes | Enables Dapper as a thin wrapper for the generated code. For more information, please refer to the Dapper documentation. |
| overrideDapperVersion | default:2.1.35values: The desired Dapper version |
Yes | If useDapper is set to true, this option allows you to override the version of Dapper to be used. |
- β means the feature is fully supported.
- π« means the database does not support the feature.
- β means the feature is not supported by the plugin (but could be supported by the database).
Basic functionality - same for all databases:
:one- returns 0...1 records:many- returns 0...n records:exec- DML / DDL that does not return anything:execrows- returns number of affected rows by DML
Advanced functionality - varies between databases:
:execlastid- INSERT with returned last inserted id:copyfrom- batch insert, implementation varies greatly
| Annotation | PostgresSQL | MySQL | SQLite |
|---|---|---|---|
| :one | β | β | β |
| :many | β | β | β |
| :exec | β | β | β |
| :execrows | β | β | β |
| :execlastid | β | β | β |
| :copyfrom | β | β | β |
More info can be found in here.
sqlc.arg- Attach a name to a parameter in a SQL querysqlc.narg- The same assqlc.arg, but always marks the parameter as nullablesqlc.slice- For databases that do not support passing arrays to theINoperator, generates a dynamic query at runtime with the correct number of parameterssqlc.embed- Embedding allows you to reuse existing model structs in more queries
| Annotation | PostgresSQL | MySQL | SQLite |
|---|---|---|---|
| sqlc.arg | β | β | β |
| sqlc.narg | β | β | β |
| sqlc.slice | π« | β | β |
| sqlc.embed | β | β | β |
More info can be found in here.