Skip to content

Instantly share code, notes, and snippets.

@ewhitmore
Created April 19, 2016 14:09
Show Gist options
  • Save ewhitmore/12c8be600dcc8733b32f3445dd794c0d to your computer and use it in GitHub Desktop.
Save ewhitmore/12c8be600dcc8733b32f3445dd794c0d to your computer and use it in GitHub Desktop.
CustomDialect for SQLITE which support DATETIME2
public class CustomDialect : SQLiteDialect
{
protected override void RegisterColumnTypes()
{
base.RegisterColumnTypes();
RegisterColumnType(DbType.DateTime2, "DATETIME2");
}
protected override void RegisterFunctions()
{
base.RegisterFunctions();
RegisterFunction("current_timestamp", new NoArgSQLFunction("TEXT", NHibernateUtil.DateTime2, true));
}
protected override void RegisterKeywords()
{
base.RegisterKeywords();
RegisterKeyword("datetime2");
}
protected override void RegisterDefaultProperties()
{
base.RegisterDefaultProperties();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment