On Sep 20, 2010, at 11:00 PM, Russell Warren wrote:

> Is there a way in the standard SQLA dialect support to set the
> starting value of an autoincrement field in the SQLA table definition?
> 
> I can't see anything in the docs or code, but something like this is
> what I'm thinking:
> 
> empnum = Column(sqla.Integer,
>                primary_key = True,
>                autoincrement = True,
>                autoincrementstart = 10000)

Look at class sqlalchemy.schema.Sequence(name, start=None, increment=None,...)
http://www.sqlalchemy.org/docs/core/schema.html?highlight=sequence#sqlalchemy.schema.Sequence


Table('sometable', metadata,
Column('id', Integer, Sequence('some_id_seq'), primary_key=True)
)
http://www.sqlalchemy.org/docs/dialects/postgresql.html?highlight=sequence

Cheers,
M

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalch...@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to