1

I have a MySQL table with a JSON column. I am able to write into this JSON field following either answer to this question, but I have not yet found a solution to be able to update the json field with the same method.

The solution I tried:

out_df.to_sql('my_table', my_sql_alchemy_engine, if_exists='append')

can go 2 ways:

  • if there are no unique keys in my table, the rows are simply added at the end of the table, with the JSON field containing only the values I wanted to make an update with
  • If there are unique fields, i get an IntegrityError

Is there any way to make that work, or should I find another solution to update my JSON fields ?

LoicM
  • 1,786
  • 16
  • 37

0 Answers0