0

Is there a way to do 'insert ignore' while using SQL Alchemy 1.3 and posting to MySQL (used to ignore records when record's primary key is already present in the table)?

I've scoured the internet, and it doesn't appear a way to use this fairly basic functionality?

Thank you!

FlyingZebra1
  • 1,285
  • 1
  • 18
  • 28

1 Answers1

0

Unfortunately the only way I could find to do this was to post each record individually using try/except . slow and painful.

for record in list_of_records:
  try:post_stuff()
  except:pass

.. if anyone has any recommendations on how to do this same thing using bulk insert IGNORE for mysql - that would be greatly appreciated.

FlyingZebra1
  • 1,285
  • 1
  • 18
  • 28