I have some generic timestamp columns as part of a mixin.  I'd like for 
these columns to have server defaults of the current UTC time.  If I wanted 
local time, I could just do:

created_ts = Column(DateTime, ..., 
server_default=sasql.text('CURRENT_TIMESTAMP'))

The problem I'm running into is that the DB servers all have a different 
way of getting UTC time:

SQLITE: select CURRENT_TIMESTAMP
Microsoft SQL: select GETUTCDATE()
PostgreSQL: select (now() at time zone 'utc')

So how do I set the server default in a db specific way when I want to be 
able to define the columns in a library that will be used on different DB 
servers?

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to