From: Yoichi NAKAYAMA Date: Tue, 24 Oct 2017 07:00:21 +0000 (+0900) Subject: Fix typo in "on duplicate key update" example X-Git-Tag: rel_1_2_0~42^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=521951b55d6184844499ba41438db19397deff87;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git Fix typo in "on duplicate key update" example --- diff --git a/doc/build/changelog/migration_12.rst b/doc/build/changelog/migration_12.rst index 5eba2def56..0205c8718d 100644 --- a/doc/build/changelog/migration_12.rst +++ b/doc/build/changelog/migration_12.rst @@ -1459,17 +1459,17 @@ is now supported using a MySQL-specific version of the This :class:`~.expression.Insert` subclass adds a new method :meth:`~.mysql.dml.Insert.on_duplicate_key_update` that implements MySQL's syntax:: - from sqlalchemy.dialect.mysql import insert + from sqlalchemy.dialects.mysql import insert insert_stmt = insert(my_table). \\ values(id='some_id', data='some data to insert') on_conflict_stmt = insert_stmt.on_duplicate_key_update( - data=stmt.inserted.data, + data=insert_stmt.inserted.data, status='U' ) - conn.execute(do_update_stmt) + conn.execute(on_conflict_stmt) The above will render::