summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-11-30 11:25:07 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2015-11-30 11:25:07 -0500
commit86e5419968be23b88ef7e2ba4de9ca6698f0540b (patch)
treee48ab29ddb2b458e797cb52c63f7e785ad1aa189
parent4fcd93afb877ec8929586c2d7b671aef1783d883 (diff)
downloadsqlalchemy-86e5419968be23b88ef7e2ba4de9ca6698f0540b.tar.gz
- make inserted_primary_key a link and be more clear what happens here
-rw-r--r--doc/build/core/tutorial.rst10
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/build/core/tutorial.rst b/doc/build/core/tutorial.rst
index 71d0d4e39..a8c68babf 100644
--- a/doc/build/core/tutorial.rst
+++ b/doc/build/core/tutorial.rst
@@ -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: