Thursday, December 26, 2013

SQLalchemy - Simple Select Query

from sqlalchemy import create_engine, MetaData, Table

engine = create_engine('sqlite:///cars.db', echo=False)
metadata = MetaData(bind=engine)

table = Table('cars', metadata)
stmt = table.select()
for row in stmt.execute():
    print row

No comments:

Post a Comment