sql alchemy date difference function to execute in all relational databases

  database, python, python-db-api, sql, sqlalchemy

We have a requirement in our project where we must be able to execute a python script ( the python script will connect to databases and executes DB queries) in all relation databases like postgres, MySQL, mssql server, Oracle.

I’m using sqlAlchemy for this requirement and for date difference I’m not able to execute same queries across multiple databases.
For example,
mssql server uses datediff function which cannot be used in postgres.
Is there a common function that I will be able to uses across all databases ??
or how to find an workaround for it.

Source: Python Questions

LEAVE A COMMENT