]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Fix typo in "on duplicate key update" example
authorYoichi NAKAYAMA <yoichi.nakayama@gmail.com>
Tue, 24 Oct 2017 07:00:21 +0000 (16:00 +0900)
committerGitHub <noreply@github.com>
Tue, 24 Oct 2017 07:00:21 +0000 (16:00 +0900)
doc/build/changelog/migration_12.rst

index 5eba2def56a10034bcb4bced4f92edb3dc92477e..0205c8718dbab12118d9323ca930c33f0348d695 100644 (file)
@@ -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::