Skip to content

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