summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-04-14 17:21:36 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-04-14 17:21:36 +0000
commitccff3a14db356ba435d77f2958e87ca8013f6ce4 (patch)
tree04b9c5be595f3ae7a2d47eb6a8fd633471a7fe2f /lib/sqlalchemy/sql
parentb26cf96462b195a4c12ccdf8283ef028f91eb872 (diff)
parent94a1c523984e2082bb16d784cf8615061ba9d49a (diff)
downloadsqlalchemy-ccff3a14db356ba435d77f2958e87ca8013f6ce4.tar.gz
Merge "Support DEFAULT VALUES and VALUES(DEFAULT) individually"
Diffstat (limited to 'lib/sqlalchemy/sql')
-rw-r--r--lib/sqlalchemy/sql/compiler.py1
-rw-r--r--lib/sqlalchemy/sql/crud.py6
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py
index 8eefa10d1..0c701cb52 100644
--- a/lib/sqlalchemy/sql/compiler.py
+++ b/lib/sqlalchemy/sql/compiler.py
@@ -3480,6 +3480,7 @@ class SQLCompiler(Compiled):
if (
not crud_params
and not self.dialect.supports_default_values
+ and not self.dialect.supports_default_metavalue
and not self.dialect.supports_empty_insert
):
raise exc.CompileError(
diff --git a/lib/sqlalchemy/sql/crud.py b/lib/sqlalchemy/sql/crud.py
index 174a1c131..5fa82bcd0 100644
--- a/lib/sqlalchemy/sql/crud.py
+++ b/lib/sqlalchemy/sql/crud.py
@@ -174,7 +174,11 @@ def _get_crud_params(compiler, stmt, compile_state, **kw):
values = _extend_values_for_multiparams(
compiler, stmt, compile_state, values, kw
)
- elif not values and compiler.for_executemany:
+ elif (
+ not values
+ and compiler.for_executemany
+ and compiler.dialect.supports_default_metavalue
+ ):
# convert an "INSERT DEFAULT VALUES"
# into INSERT (firstcol) VALUES (DEFAULT) which can be turned
# into an in-place multi values. This supports