We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 09cc33f commit 37d7ca1Copy full SHA for 37d7ca1
2 files changed
src/sql_tstring/__init__.py
@@ -145,6 +145,8 @@ def _safely_convert_placeholder_value(
145
if case_insensitive is None:
146
case_insensitive = set()
147
148
+ if value is None:
149
+ return "NULL"
150
if isinstance(value, bool):
151
return str(value)
152
if allow_numeric and isinstance(value, Number):
tests/test_identifiers.py
@@ -45,6 +45,13 @@ def test_numeric_invalid() -> None:
45
sql("SELECT {a}", locals())
46
47
48
+def test_none() -> None:
49
+ a = None
50
+ query, values = sql("SELECT {a}", locals())
51
+ assert query == "SELECT NULL"
52
+ assert values == []
53
+
54
55
def test_partition_by() -> None:
56
a = RewritingValue.ABSENT
57
b = "x"
0 commit comments