> On Nov 6, 2014, at 12:00 PM, Matthew Rocklin <[email protected]> wrote: > > What is the status of database agnostic datetime access functions like "day > of month" or "day or year”?
rudimental fields of a date are available on supported databases (meaning, not SQLite) via EXTRACT: http://docs.sqlalchemy.org/en/rel_0_9/core/sqlelement.html?highlight=extract#sqlalchemy.sql.expression.extract <http://docs.sqlalchemy.org/en/rel_0_9/core/sqlelement.html?highlight=extract#sqlalchemy.sql.expression.extract> it’s not by itself DB agnostic, you’d need to make sure the backend accepts the common EXTRACT keywords like “YEAR”, “MONTH”, etc. any kind of backend-agnostic date implementation is a “nice to have”, including date arithmetic and such, and is at https://bitbucket.org/zzzeek/sqlalchemy/issue/2769/preliminary-date-operation-support <https://bitbucket.org/zzzeek/sqlalchemy/issue/2769/preliminary-date-operation-support>. There’s no timeline for this as it is both low priority and would be very complex. Just getting date arithmetic to perform equally between SQL Server and Postgresql I found to be very difficult, not to mention it would be a new and complex API. -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
