0

well aware that something similar has been already discussed in detail (here), nevertheless my question concerns those cases in which a raw SQL must be executed. Given the following example from SQLAlchemy official documentation:

>>> from sqlalchemy.sql import text
>>> s = text(
...     "SELECT users.fullname || ', ' || addresses.email_address AS title "
...         "FROM users, addresses "
...         "WHERE users.id = addresses.user_id "
...         "AND users.name BETWEEN :x AND :y "
...         "AND (addresses.email_address LIKE :e1 "
...             "OR addresses.email_address LIKE :e2)")
>>> conn.execute(s, x='m', y='z', e1='%@aol.com', e2='%@msn.com').fetchall()

how can I print the actual SQL statemet with its params?

Ilja Everilä
  • 45,748
  • 6
  • 100
  • 105
Pankus
  • 1,037
  • 1
  • 11
  • 17

0 Answers0