Many third party libraries support database connectivity with functions that mimic the PEP-249 .execute ( operation [, parameters ])
function.
An example is the pandas.read_sql(query, engine, params)
function.
The problem is that the params spec varies depending on the engine. For example SQLite uses ?
, MySQL uses %s
etc in the query. The params needs to be either a list or a dict depending on the engine.
Using SQLAlchemy to handle the different engines, how can we get the appropriate query and params arguments to pass to execute
.
(Note this is a different question to this question - I want to keep the query and parameters separate)