summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/testing/provision.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/testing/provision.py')
-rw-r--r--lib/sqlalchemy/testing/provision.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/sqlalchemy/testing/provision.py b/lib/sqlalchemy/testing/provision.py
index 7ba89b505..a8650f222 100644
--- a/lib/sqlalchemy/testing/provision.py
+++ b/lib/sqlalchemy/testing/provision.py
@@ -459,3 +459,19 @@ def set_default_schema_on_connection(cfg, dbapi_connection, schema_name):
"backend does not implement a schema name set function: %s"
% (cfg.db.url,)
)
+
+
+@register.init
+def upsert(cfg, table, returning, set_lambda=None):
+ """return the backends insert..on conflict / on dupe etc. construct.
+
+ while we should add a backend-neutral upsert construct as well, such as
+ insert().upsert(), it's important that we continue to test the
+ backend-specific insert() constructs since if we do implement
+ insert().upsert(), that would be using a different codepath for the things
+ we need to test like insertmanyvalues, etc.
+
+ """
+ raise NotImplementedError(
+ f"backend does not include an upsert implementation: {cfg.db.url}"
+ )