Fixed introspection of default values TRUE / FALSE / NULL

Closes #836
This commit is contained in:
Simon Willison 2026-08-12 14:19:30 -07:00
commit 88b48fa167
3 changed files with 42 additions and 0 deletions

View file

@ -5270,6 +5270,13 @@ def _decode_default_value(value: str) -> object:
# It's a binary string, stored as hex
to_decode = value[2:-1]
return binascii.unhexlify(to_decode)
upper = value.upper()
if upper == "TRUE":
return True
if upper == "FALSE":
return False
if upper == "NULL":
return None
# If it is a string containing a floating point number:
try:
return float(value)