ILIKE on postgres, lower(x) LIKE lower(y) on all
others. [ticket:727]
- - Added "now()" as a generic function; on SQLite and Oracle
- compiles as "CURRENT_TIMESTAMP"; "now()" on all others
- [ticket:943]
+ - Added "now()" as a generic function; on SQLite, Oracle
+ and MSSQL compiles as "CURRENT_TIMESTAMP"; "now()" on
+ all others. [ticket:943]
- The startswith(), endswith(), and contains() operators now
concatenate the wildcard operator with the given operand in
import datetime, operator, random, re, sys
from sqlalchemy import sql, schema, exceptions, util
-from sqlalchemy.sql import compiler, expression, operators as sqlops
+from sqlalchemy.sql import compiler, expression, operators as sqlops, functions as sql_functions
from sqlalchemy.engine import default, base
from sqlalchemy import types as sqltypes
from sqlalchemy.util import Decimal as _python_Decimal
+
MSSQL_RESERVED_WORDS = util.Set(['function'])
class MSNumeric(sqltypes.Numeric):
operators = compiler.OPERATORS.copy()
operators[sqlops.concat_op] = '+'
+ functions = compiler.DefaultCompiler.functions.copy()
+ functions.update (
+ {
+ sql_functions.now: 'CURRENT_TIMESTAMP'
+ }
+ )
+
def __init__(self, *args, **kwargs):
super(MSSQLCompiler, self).__init__(*args, **kwargs)
self.tablealiases = {}