spoqa / sqlalchemy-utc

SQLAlchemy type to store aware datetime values
https://pypi.python.org/pypi/SQLAlchemy-Utc
MIT License
101 stars 20 forks source link

Add utcnow sqlalchemy expression #4

Closed gwax closed 6 years ago

gwax commented 6 years ago

This PR introduces a compiled SQLAlchemy FunctionElement to provide UTC time on the server: utcnow. Server times are primarily for use as default values in UtcDateTime columns:

table = Table(
    'some_table', MetaData(),
    Column('time', UtcDateTime(), default=utcnow()))
codecov-io commented 6 years ago

Codecov Report

Merging #4 into master will decrease coverage by 1.31%. The diff coverage is 92.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #4      +/-   ##
==========================================
- Coverage   96.77%   95.45%   -1.32%     
==========================================
  Files           3        4       +1     
  Lines          31       44      +13     
==========================================
+ Hits           30       42      +12     
- Misses          1        2       +1
Impacted Files Coverage Δ
sqlalchemy_utc/version.py 100% <100%> (ø) :arrow_up:
sqlalchemy_utc/now.py 92.3% <92.3%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 4b99c17...9fdfa5a. Read the comment docs.

gwax commented 6 years ago

@dahlia this PR is now ready for merge

dahlia commented 6 years ago

Thanks for your patches. This one is what you've actually wanted to merge to the master, right? Is it okay to release a new version at this time?

gwax commented 6 years ago

Yes, this is the feature that I have been building toward. Now would be a fine time to cut a new version.

dahlia commented 6 years ago

@gwax Just released a new version!