Skip to content

Instantly share code, notes, and snippets.

@squeaky-pl
Last active September 14, 2016 15:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save squeaky-pl/5c7bd7e012c258f507391e45d5275a6a to your computer and use it in GitHub Desktop.
Save squeaky-pl/5c7bd7e012c258f507391e45d5275a6a to your computer and use it in GitHub Desktop.
In [24]: from sqlalchemy.sql.expression import delete
In [26]: delete(User).where(User.id == 4)
Out[26]: <sqlalchemy.sql.dml.Delete object at 0x7f4b8f7f1b00>
In [28]: s = delete(User).where(User.id == 4)
In [32]: c = s.compile(dialect=dialect)
In [33]: str(c)
Out[33]: 'DELETE FROM users WHERE users.id = :id_1'
In [35]: c.params
Out[35]: {'id_1': 4}
In [36]:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment