- dialects
- Invalid SQLite connection URLs now raise an error.
+ - postgres TIMESTAMP renders correctly [ticket:981]
0.4.3
------
}
)
+ functions = compiler.DefaultCompiler.functions.copy()
+ functions.update (
+ {
+ 'TIMESTAMP':lambda x:'TIMESTAMP %s' % x,
+ }
+ )
+
def visit_sequence(self, seq):
if seq.optional:
return None
name = self.function_string(func)
if callable(name):
- return name(*[self.process(x) for x in func.clause_expr])
+ return name(*[self.process(x) for x in func.clauses])
else:
return ".".join(func.packagenames + [name]) % {'expr':self.function_argspec(func)}
return self.process(func.clause_expr)
def function_string(self, func):
- return self.functions.get(func.__class__, func.name + "%(expr)s")
+ return self.functions.get(func.__class__, self.functions.get(func.name, func.name + "%(expr)s"))
def visit_compound_select(self, cs, asfrom=False, parens=True, **kwargs):
stack_entry = {'select':cs}
self.assertEquals(results[1]['strarr'], [[u'm\xe4\xe4'], [u'm\xf6\xf6']])
arrtable.delete().execute()
+class TimeStampTest(TestBase, AssertsExecutionResults):
+ __only_on__ = 'postgres'
+ def test_timestamp(self):
+ engine = testing.db
+ connection = engine.connect()
+ s = select([func.TIMESTAMP("12/25/07").label("ts")])
+ result = connection.execute(s).fetchone()
+ self.assertEqual(result[0], datetime.datetime(2007, 12, 25, 0, 0))
+
+
if __name__ == "__main__":
testenv.main()