Skip to content

Commit

Permalink
Replce query with SQL_INSERT_DATA
Browse files Browse the repository at this point in the history
  • Loading branch information
yankeexe committed Nov 25, 2019
1 parent 061823e commit 1a61ef2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/data-transfer-pg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def transfer_data(source_db_cursor, dest_db_cursor, dest_db_conn):

print(f'Transferring users data to destination database.')
for row in rows:
dest_db_cursor.execute('INSERT INTO users VALUES (?, ?, ?)', (row.id, row.name, row.city))
dest_db_cursor.execute(SQL_INSERT_DATA, (row.id, row.name, row.city))
dest_db_conn.commit()

print(f"Transferred {len(rows)} rows of users data from source database to destination database.")
Expand Down

0 comments on commit 1a61ef2

Please sign in to comment.