mirror of
https://github.com/simonw/datasette.git
synced 2026-09-19 23:14:06 +02:00
escape_sqlite() favors double quotes, closes #2795
This commit is contained in:
parent
39f1df5997
commit
22ccd8a087
2 changed files with 24 additions and 11 deletions
|
|
@ -410,12 +410,7 @@ def escape_css_string(s):
|
|||
def escape_sqlite(s):
|
||||
if _boring_keyword_re.match(s) and (s.lower() not in reserved_words):
|
||||
return s
|
||||
elif "]" in s:
|
||||
# SQLite does not support escaping ] inside [bracket] quoting, so fall
|
||||
# back to double-quote quoting (doubling any embedded ") - #2677
|
||||
return '"{}"'.format(s.replace('"', '""'))
|
||||
else:
|
||||
return f"[{s}]"
|
||||
return '"{}"'.format(s.replace('"', '""'))
|
||||
|
||||
|
||||
def make_dockerfile(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue