Fix for test_table_default_values

Refs https://github.com/simonw/sqlite-utils/pull/764#issuecomment-4889359434
This commit is contained in:
Simon Willison 2026-07-05 22:22:33 -07:00
commit ddd5373735

View file

@ -710,7 +710,7 @@ class Database:
if str(value).upper() in ("CURRENT_TIME", "CURRENT_DATE", "CURRENT_TIMESTAMP"): if str(value).upper() in ("CURRENT_TIME", "CURRENT_DATE", "CURRENT_TIMESTAMP"):
return value return value
if str(value).upper() in ("TRUE", "FALSE", "NULL"): if isinstance(value, str) and value.upper() in ("TRUE", "FALSE", "NULL"):
# Keyword literals must stay unquoted; quoting them would turn the # Keyword literals must stay unquoted; quoting them would turn the
# default into a string ('TRUE' instead of 1, 'NULL' instead of null). # default into a string ('TRUE' instead of 1, 'NULL' instead of null).
return value return value