I have data read from json and fed into an sqlite database with proper schema using sql-alchemy in python. (used pd.dataframe.to_sql() for this). I want the database dump (.sql
Assuming that you have a SQLAlchemy engine object associated with your SQLite database you can simply use Python's iterdump method like so:
engine
con = engine.raw_connection() with open('C:/Users/Gord/Desktop/dump.sql', 'w') as f: for line in con.iterdump(): f.write('%s\n' % line)