Permalink
Browse files

Dialects: Added some missing functions for SQLite and Firebird.

  • Loading branch information...
1 parent 3b0aa49 commit fbc88b0a58962d44004df8da3dd9c655238d3d88 @pleasantsolutions pleasantsolutions committed Sep 26, 2011
Showing with 6 additions and 3 deletions.
  1. +4 −2 src/NHibernate/Dialect/FirebirdDialect.cs
  2. +2 −1 src/NHibernate/Dialect/SQLiteDialect.cs
View
6 src/NHibernate/Dialect/FirebirdDialect.cs
@@ -122,8 +122,10 @@ public FirebirdDialect()
RegisterFunction("rtrim", new StandardSQLFunction("rtrim"));
RegisterFunction("strlen", new StandardSQLFunction("strlen", NHibernateUtil.Int16));
RegisterFunction("substr", new StandardSQLFunction("substr"));
- RegisterFunction("substrlen", new StandardSQLFunction("substrlen", NHibernateUtil.Int16));
- //BLOB Functions
+ RegisterFunction("substrlen", new StandardSQLFunction("substrlen", NHibernateUtil.Int16));
+ RegisterFunction("locate", new SQLFunctionTemplate(NHibernateUtil.Int32, "position(?1, ?2, ?3)"));
+ RegisterFunction("replace", new StandardSafeSQLFunction("replace", NHibernateUtil.String, 3));
+ //BLOB Functions
RegisterFunction("string2blob", new StandardSQLFunction("string2blob"));
//Trigonometric Functions
RegisterFunction("acos", new StandardSQLFunction("acos", NHibernateUtil.Double));
View
3 src/NHibernate/Dialect/SQLiteDialect.cs
@@ -76,7 +76,8 @@ protected virtual void RegisterFunctions()
RegisterFunction("substring", new StandardSQLFunction("substr", NHibernateUtil.String));
RegisterFunction("left", new SQLFunctionTemplate(NHibernateUtil.String, "substr(?1,1,?2)"));
- RegisterFunction("trim", new AnsiTrimEmulationFunction());
+ RegisterFunction("trim", new AnsiTrimEmulationFunction());
+ RegisterFunction("replace", new StandardSafeSQLFunction("replace", NHibernateUtil.String, 3));
RegisterFunction("mod", new SQLFunctionTemplate(NHibernateUtil.Int32, "((?1) % (?2))"));

0 comments on commit fbc88b0

Please sign in to comment.