[sqlalchemy] Re: How to add the index_elements to the on_conflict_do_update() method

2021-12-07 Thread Chaozy Z
I also tried to add unique=True to the column message_id but still fail with the same error On Tuesday, 7 December 2021 at 22:21:49 UTC Chaozy Z wrote: > Hi there, I just started to learn SQLAlchemy. 0 > > > I have a `on_conflict_do_update`

[sqlalchemy] How to add the index_elements to the on_conflict_do_update() method

2021-12-07 Thread Chaozy Z
Hi there, I just started to learn SQLAlchemy. 0 I have a `on_conflict_do_update` command as follows: ``` insert_stmt = insert(MessageSymbol).values(message_id=12345, symbol_id=1) do_update_stmt = insert_stmt.on_conflict_do_update(

[sqlalchemy] How to add constraint or index_elements to the `on_conflict_do_update()`

2021-12-07 Thread Chaozy Z
Hi there, I just started to learn SQLAlchemy. 0 I have a `on_conflict_do_update` command as follows: ``` insert_stmt = insert(MessageSymbol).values(message_id=12345, symbol_id=1) do_update_stmt = insert_stmt.on_conflict_do_update(