1. idank
  2. sqlalchemy


Mike Bayer  committed 37ef5b2

add micro-doc for sequence standalone execution

  • Participants
  • Parent commits b58833c
  • Branches default

Comments (0)

Files changed (1)

File doc/build/content/metadata.txt

View file
  • Ignore whitespace
 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