]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- make inserted_primary_key a link and be more clear what happens here
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 30 Nov 2015 16:25:07 +0000 (11:25 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 30 Nov 2015 16:25:07 +0000 (11:25 -0500)
doc/build/core/tutorial.rst

index 71d0d4e39787f0e2c240c023b334aff4ae52029c..a8c68babf2eef4f60d28c76a6b82ab04056a9aea 100644 (file)
@@ -290,7 +290,8 @@ the SQLAlchemy :class:`~sqlalchemy.engine.Connection` object references a
 DBAPI connection, the result, known as a
 :class:`~sqlalchemy.engine.ResultProxy` object, is analogous to the DBAPI
 cursor object. In the case of an INSERT, we can get important information from
-it, such as the primary key values which were generated from our statement:
+it, such as the primary key values which were generated from our statement
+using :attr:`.ResultProxy.inserted_primary_key`:
 
 .. sourcecode:: pycon+sql
 
@@ -304,8 +305,11 @@ value would have been used. In either case, SQLAlchemy always knows how to get
 at a newly generated primary key value, even though the method of generating
 them is different across different databases; each database's
 :class:`~sqlalchemy.engine.interfaces.Dialect` knows the specific steps needed to
-determine the correct value (or values; note that ``inserted_primary_key``
-returns a list so that it supports composite primary keys).
+determine the correct value (or values; note that
+:attr:`.ResultProxy.inserted_primary_key`
+returns a list so that it supports composite primary keys).    Methods here
+range from using ``cursor.lastrowid``, to selecting from a database-specific
+function, to using ``INSERT..RETURNING`` syntax; this all occurs transparently.
 
 .. _execute_multiple: