0
engine = create_engine('postgresql://user:password@server/db')
df.to_sql('new_table', con=engine, if_exists='append', index=False, chunksize=20000)

I want to print a message every time a chunksize has to been written to the DB, so that I know the script is successfully running. How can I achieve this?

Snow
  • 938
  • 15
  • 41

1 Answers1

1

You can always chunk it up manually and process chunks in a loop inside which you can setup message printing or a progress bar. See an example here.