Skip to content

Instantly share code, notes, and snippets.

@Tukki
Created November 17, 2014 09:24
Show Gist options
  • Save Tukki/4a931174a829e0b01b51 to your computer and use it in GitHub Desktop.
Save Tukki/4a931174a829e0b01b51 to your computer and use it in GitHub Desktop.
sqlalchemy reflecting all tables
Reflecting All Tables at Once
The MetaData object can also get a listing of tables and reflect the full set. This is achieved by using the reflect() method. After calling it, all located tables are present within the MetaData object’s dictionary of tables:
meta = MetaData()
meta.reflect(bind=someengine)
users_table = meta.tables['users']
addresses_table = meta.tables['addresses']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment