Skip to content

Instantly share code, notes, and snippets.

@NMelis
Created January 30, 2019 07:34
Show Gist options
  • Save NMelis/993331ef22a3285755410083f1c4993f to your computer and use it in GitHub Desktop.
Save NMelis/993331ef22a3285755410083f1c4993f to your computer and use it in GitHub Desktop.
clear data base
def clear_data(db):
meta = db.metadata
for table in reversed(meta.sorted_tables):
print(table)
session.execute(table.delete())
session.commit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment