mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-18 14:34:24 +02:00
Merge ad77d36a55 into a947dc6739
This commit is contained in:
commit
f8ca2e4347
2 changed files with 2 additions and 1 deletions
|
|
@ -5214,7 +5214,7 @@ def _decode_default_value(value: str) -> object:
|
||||||
if value.startswith("'") and value.endswith("'"):
|
if value.startswith("'") and value.endswith("'"):
|
||||||
# It's a string
|
# It's a string
|
||||||
return value[1:-1]
|
return value[1:-1]
|
||||||
if value.isdigit():
|
if re.fullmatch(r"-?\d+", value):
|
||||||
# It's an integer
|
# It's an integer
|
||||||
return int(value)
|
return int(value)
|
||||||
if value.startswith("X'") and value.endswith("'"):
|
if value.startswith("X'") and value.endswith("'"):
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,7 @@ def test_table_strict(fresh_db, create_table, expected_strict):
|
||||||
"value",
|
"value",
|
||||||
(
|
(
|
||||||
1,
|
1,
|
||||||
|
-5,
|
||||||
1.3,
|
1.3,
|
||||||
"foo",
|
"foo",
|
||||||
True,
|
True,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue