Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SQL INTERVAL Types by mapping to two distinct Python types #324

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

padhia
Copy link

@padhia padhia commented Jan 5, 2018

SQL INTERVAL types are classified into two distinct groups -- one that has month as the most granular time period and the other which has microsecond as the most granular time period. Per the SQL standard, it is meaningless to convert from one group of interval types to the other and thus is not permitted.

This PR provides support for these two groups of SQL INTERVAL types by mapping them to Python int (number of months) and datetime.timedelta respectively as their canonical representations.

@mkleehammer
Copy link
Owner

Nice job coming up with a reasonable interface: month & microsecond.

Can you add some unit tests for at least SQL Server and PostgreSQL for these before we merge?

@v-chojas
Copy link
Contributor

@mkleehammer FYI SQL Server has no interval types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants