Created
November 17, 2014 09:24
-
-
Save Tukki/4a931174a829e0b01b51 to your computer and use it in GitHub Desktop.
sqlalchemy reflecting all tables
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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