Created
October 25, 2019 08:06
-
-
Save buxx/1e552aa80053570d4cf72cb445996780 to your computer and use it in GitHub Desktop.
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
src = create_engine('mysql+oursql://username:[email protected]:3306/dbname') | |
dst = create_engine('postgresql://username:password@localhost:5432/dbname') | |
tables = Base.metadata.tables; | |
for tbl in tables: | |
data = src.execute(tables[tbl].select()).fetchall() | |
for a in data: print(a) | |
if data: | |
print (tables[tbl].insert()) | |
dst.execute( tables[tbl].insert(), data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment