summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThodoris Sotiropoulos <theosotr@aueb.gr>2020-06-11 10:50:41 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-06-11 10:53:05 -0400
commited4a4896aea7dd77dd5d8a9861302811ac421e47 (patch)
tree2bd403a9d77edd21f0afcfce0e8cbb8e92117c56
parente1d4e59116bbf1a12bb6b3f57d33ddfc757d4567 (diff)
downloadsqlalchemy-ed4a4896aea7dd77dd5d8a9861302811ac421e47.tar.gz
Add 'exists' to SQLite's reserved keywords
Added "exists" to the list of reserved words for SQLite so that this word will be quoted when used as a label or column name. Pull request courtesy Thodoris Sotiropoulos. Fixes: #5395 Closes: #5396 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5396 Pull-request-sha: 5608317a38db7b63115e3b467d182a3e5cc31580 Change-Id: Ia4769de2dec159dcf282eb4b30c11560da51a5c7
-rw-r--r--doc/build/changelog/unreleased_13/5395.rst7
-rw-r--r--lib/sqlalchemy/dialects/sqlite/base.py1
-rw-r--r--test/dialect/test_sqlite.py1
3 files changed, 9 insertions, 0 deletions
diff --git a/doc/build/changelog/unreleased_13/5395.rst b/doc/build/changelog/unreleased_13/5395.rst
new file mode 100644
index 000000000..9e11cdcba
--- /dev/null
+++ b/doc/build/changelog/unreleased_13/5395.rst
@@ -0,0 +1,7 @@
+.. change::
+ :tags: bug, sqlite
+ :tickets: 5395
+
+ Added "exists" to the list of reserved words for SQLite so that this word
+ will be quoted when used as a label or column name. Pull request courtesy
+ Thodoris Sotiropoulos.
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py
index 15d125ce0..a203e786e 100644
--- a/lib/sqlalchemy/dialects/sqlite/base.py
+++ b/lib/sqlalchemy/dialects/sqlite/base.py
@@ -1334,6 +1334,7 @@ class SQLiteIdentifierPreparer(compiler.IdentifierPreparer):
"escape",
"except",
"exclusive",
+ "exists",
"explain",
"false",
"fail",
diff --git a/test/dialect/test_sqlite.py b/test/dialect/test_sqlite.py
index fabbfa4a4..719834d4a 100644
--- a/test/dialect/test_sqlite.py
+++ b/test/dialect/test_sqlite.py
@@ -639,6 +639,7 @@ class DialectTest(
Column("true", Integer),
Column("false", Integer),
Column("column", Integer),
+ Column("exists", Integer),
)
try:
meta.create_all()