Created
April 19, 2016 14:09
-
-
Save ewhitmore/12c8be600dcc8733b32f3445dd794c0d to your computer and use it in GitHub Desktop.
CustomDialect for SQLITE which support DATETIME2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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