--- /dev/null
+.. change::
+ :tags: bug, sqlite
+ :tickets: 12566
+
+ Fixed and added test support for a few SQLite SQL functions hardcoded into
+ the compiler most notably the "localtimestamp" function which rendered with
+ incorrect internal quoting.
return "CURRENT_TIMESTAMP"
def visit_localtimestamp_func(self, func, **kw):
- return 'DATETIME(CURRENT_TIMESTAMP, "localtime")'
+ return "DATETIME(CURRENT_TIMESTAMP, 'localtime')"
def visit_true(self, expr, **kw):
return "1"
" y INTEGER GENERATED ALWAYS AS (x + 2)%s)" % text,
)
+ @testing.combinations(
+ (func.localtimestamp(),),
+ (func.now(),),
+ (func.char_length("test"),),
+ (func.aggregate_strings("abc", ","),),
+ argnames="fn",
+ )
+ def test_builtin_functions_roundtrip(self, fn, connection):
+ connection.execute(select(fn))
+
class AttachedDBTest(fixtures.TablesTest):
__only_on__ = "sqlite"
def test_localtime(self):
self.assert_compile(
- func.localtimestamp(), 'DATETIME(CURRENT_TIMESTAMP, "localtime")'
+ func.localtimestamp(), "DATETIME(CURRENT_TIMESTAMP, 'localtime')"
)
def test_constraints_with_schemas(self):