From 660ff51df0433607b12c58a12c7355107c1773f5 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 8 Feb 2020 14:53:21 -0500 Subject: Fixes for public_factory and mysql/pg dml functions * ensure that the location indicated by public_factory is importable * adjust all of sqlalchemy.sql.expression locations to be correct * support the case where a public_factory is against a function that has another public_factory already, and already replaced the __init__ on the target class * Use mysql.insert(), postgresql.insert(), don't include .dml in the class path. Change-Id: Iac285289455d8d7102349df3814f7cedc758e639 --- lib/sqlalchemy/dialects/postgresql/dml.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql/dml.py') diff --git a/lib/sqlalchemy/dialects/postgresql/dml.py b/lib/sqlalchemy/dialects/postgresql/dml.py index ec40ae87e..626f81018 100644 --- a/lib/sqlalchemy/dialects/postgresql/dml.py +++ b/lib/sqlalchemy/dialects/postgresql/dml.py @@ -23,6 +23,9 @@ class Insert(StandardInsert): Adds methods for PG-specific syntaxes such as ON CONFLICT. + The :class:`.postgresql.Insert` object is created using the + :func:`sqlalchemy.dialects.postgresql.insert` function. + .. versionadded:: 1.1 """ @@ -139,7 +142,9 @@ class Insert(StandardInsert): ) -insert = public_factory(Insert, ".dialects.postgresql.insert") +insert = public_factory( + Insert, ".dialects.postgresql.insert", ".dialects.postgresql.Insert" +) class OnConflictClause(ClauseElement): -- cgit v1.2.1