summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlly Cope <olly@ollycope.com>2022-10-02 20:41:01 +0000
committerOlly Cope <olly@ollycope.com>2022-10-02 20:41:01 +0000
commit2fb8cd3fd08b05a25570d0f7c453ff8611fe77d4 (patch)
tree3484d22e11551a64fa757a394974f3e7f8750a50
parentd30a42861875fc4cd3d5d6e0b84ec4e1c8958936 (diff)
downloadyoyo-2fb8cd3fd08b05a25570d0f7c453ff8611fe77d4.tar.gz
Make backend.quote_identifier more robust
-rw-r--r--yoyo/backends/base.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/yoyo/backends/base.py b/yoyo/backends/base.py
index f288d19..3c1f9a7 100644
--- a/yoyo/backends/base.py
+++ b/yoyo/backends/base.py
@@ -225,7 +225,9 @@ class DatabaseBackend:
raise NotImplementedError()
def quote_identifier(self, s):
- return '"{}"'.format(s)
+ assert "\x00" not in s
+ quoted = s.replace('"', '""')
+ return f'"{quoted}"'
def _check_transactional_ddl(self):
"""