Is there a way where I can use an existing table in my sql server with SQLAlchemy? I want to insert data and I want to use an existing table, a table I didn't define using classes.
I am using Python 2.7 and SQLAlchemy 0.8
It is possible in 0.8 by defining a autoload
-ed table:
foo = Table('foo', meta, autoload=True, autoload_with=engine)
Table columns can be accessed via foo.c
:
print list(foo.c)
Starting from 0.9.1, SQLAlchemy has experimental extension called automap
.