Created
November 5, 2014 19:03
-
-
Save dchaplinsky/afe42623c7d4007b06f8 to your computer and use it in GitHub Desktop.
A neat way to print raw SQL for SQLAlchemy statement with dialect specific stuff and all params substituted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sqlalchemy.dialects import postgresql | |
print(YOUR_SQL.statement.compile(dialect=postgresql.dialect(), compile_kwargs={"literal_binds": True})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment