sqlalchemy-utc
sqlalchemy-utc copied to clipboard
Please document how to use the `mysql_sql_utcnow` functions
The functions in now.py look great! But I have no idea how to use them properly. Can you provide a snippet where you actually use them? Thanks!
You can simply substitute existing sqlalchemy.sql.functions.now with sqlalchemy_utc.now.utcnow, e.g.:
from sqlalchemy_utc.now import utcnow
article = Article(title='…', content='…', published_at=utcnow())
You can also use them as server defaults: sa.Column('timestamp', sa.DateTime(True), server_default=utcnow())