Expressions let you compose SQL statements by building Python objects.
- Instead of sending raw SQL (using the Engine), we can compose python objects to compose SQL expressions, instead.
- SQL Expressions still involves using the knowing SQL to interact with the database.
todos = Table('todos',...)
ins = todos.insert().values(
description = 'Clean my room',
completed = False
)
s = select([todos])
conn = engine.connect()
result = conn.execute(ins)
result = conn.execute(s)
result.close()