Other databases
Jerrycurl supports all database connectors that adhere to the ADO.NET specification and requires no
more than a somewhat ISO-compliant SQL dialect and an IDbConnection
factory.
class MyDomain : IDomain
{
public void Configure(DomainOptions options)
{
options.ConnectionFactory = () => new FooConnection("...");
}
}
Dialects
The compliance Razor SQL needs to function properly is:
- quoted identifiers, i.e.
SELECT "Title" FROM "Blog"
. - @-parameters, i.e.
WHERE "Rating" > @P0
.
If your database does not follow these rules, you can add a custom
implementation of IDialect
or IsoDialect
, e.g.
for changing quotes to pings and @-parameters to ?-parameters.
public class FooDialect : IsoDialect
{
public override char IdentifierQuote => '`';
public override char ParameterPrefix => '?';
}
Add this to your domain configuration.
options.Dialect = new FooDialect();
Write Razor code as you normally would.
SELECT @R.Star()
FROM @R.Tbl()
WHERE @R.Col(m => m.CreatedOn) >= @M.Par()
And generate SQL that works with your database.
SELECT T0.`Id` AS `Item.Id`, -- ...
FROM "Blog" T0
WHERE T0.`CreatedOn` >= ?P0
Official support
Jerrycurl out of the box supports the big five database systems: SQL Server, SQLite, Oracle, PostgreSQL and MySQL.