diff options
| author | RamonWill <ramonwilliams@hotmail.co.uk> | 2020-09-14 18:22:34 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-11-08 13:34:24 -0500 |
| commit | 89ddd0b8976ed695d239898a2a8e4ebf531537f2 (patch) | |
| tree | 31728325dbdea93b96fb80af4895d29d6e7c57b9 /lib/sqlalchemy/dialects/mysql/base.py | |
| parent | 75fb71d25e988bcc13629469cb6739ad7eb539e9 (diff) | |
| download | sqlalchemy-89ddd0b8976ed695d239898a2a8e4ebf531537f2.tar.gz | |
Implement upsert for SQLite
Implemented INSERT... ON CONFLICT clause for SQLite. Pull request courtesy
Ramon Williams.
Fixes: #4010
Closes: #5580
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5580
Pull-request-sha: fb422e0749fac442a455cbce539ef662d9512bc0
Change-Id: Ibeea44f4c2cee8dab5dc22b7ec3ae1ab95c12b65
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 3ad0e3813..27c7b2239 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -482,7 +482,7 @@ an error or to skip performing an UPDATE. existing row, using any combination of new values as well as values from the proposed insertion. These values are normally specified using keyword arguments passed to the -:meth:`~.mysql.Insert.on_duplicate_key_update` +:meth:`_mysql.Insert.on_duplicate_key_update` given column key values (usually the name of the column, unless it specifies :paramref:`_schema.Column.key` ) as keys and literal or SQL expressions @@ -537,7 +537,7 @@ this context is unambiguous: .. warning:: - The :meth:`_expression.Insert.on_duplicate_key_update` + The :meth:`_mysql.Insert.on_duplicate_key_update` method does **not** take into account Python-side default UPDATE values or generation functions, e.g. e.g. those specified using :paramref:`_schema.Column.onupdate`. @@ -547,8 +547,8 @@ this context is unambiguous: In order to refer to the proposed insertion row, the special alias -:attr:`~.mysql.Insert.inserted` is available as an attribute on -the :class:`.mysql.Insert` object; this object is a +:attr:`_mysql.Insert.inserted` is available as an attribute on +the :class:`_mysql.Insert` object; this object is a :class:`_expression.ColumnCollection` which contains all columns of the target table: |
