]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
add micro-doc for sequence standalone execution
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Sep 2007 23:29:11 +0000 (23:29 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Wed, 26 Sep 2007 23:29:11 +0000 (23:29 +0000)
doc/build/content/metadata.txt

index a76cd6724130f4564b30f4d85dd17c4c56ece7e8..1baa66364e5568106aa87182c0e6a1c81404eb2f 100644 (file)
@@ -396,6 +396,12 @@ When the `Sequence` is associated with a table, CREATE and DROP statements issue
 
 The flag `optional=True` on `Sequence` will produce a sequence that is only used on databases which have no "autoincrementing" capability.  For example, Postgres supports primary key generation using the SERIAL keyword, whereas Oracle has no such capability.  Therefore, a `Sequence` placed on a primary key column with `optional=True` will only be used with an Oracle backend but not Postgres.
 
+A sequence can also be executed standalone, using an `Engine` or `Connection`, returning its next value in a database-independent fashion:
+
+    {python}
+    seq = Sequence('some_sequence')
+    nextid = connection.execute(seq)
+
 ### Defining Constraints and Indexes {@name=constraints}
 
 #### UNIQUE Constraint