How do I get a compiled SQL query from a SQLAlchemy expression if params is a dict?

446 Views Asked by At

I have this code (using sqlalchemy):

 session = self._new_session(database_id=dbname)
 with session.begin():
    result_proxy = session.execute(sql_query, sql_params)

where

sql_query = 'select * from t_client where id = :id'
sql_params = {'id': 5131}

How may I see the actual query before executing without using regular expression? I mean something like this:

select * from t_client where id = 5131
0

There are 0 best solutions below