diff options
author | Olly Cope <olly@ollycope.com> | 2022-10-02 20:41:01 +0000 |
---|---|---|
committer | Olly Cope <olly@ollycope.com> | 2022-10-02 20:41:01 +0000 |
commit | 2fb8cd3fd08b05a25570d0f7c453ff8611fe77d4 (patch) | |
tree | 3484d22e11551a64fa757a394974f3e7f8750a50 | |
parent | d30a42861875fc4cd3d5d6e0b84ec4e1c8958936 (diff) | |
download | yoyo-2fb8cd3fd08b05a25570d0f7c453ff8611fe77d4.tar.gz |
Make backend.quote_identifier more robust
-rw-r--r-- | yoyo/backends/base.py | 4 |
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): """ |