OnConflictDoNothing with mysql
Hi everyone,
I want to use the on conflict do nothing method described here: https://orm.drizzle.team/docs/insert#onconflict-and-upsert-insert-or-update.
But it seems to be that only onConflictDoUpdate is available. Is this database specific or Am I doing something wrong here?
this is my query:
SQL Insert - DrizzleORM
Drizzle ORM | %s
3 Replies
ON CONFLICT DO NOTHING doesn't exists in Mysql, unfortunately the docs are not clear on that fact
for MySql we have
onDuplicateKeyUpdate
Stack Overflow
INSERT ... ON DUPLICATE KEY (do nothing)
I have a table with a unique key for two columns:
CREATE TABLE
xpo
.user_permanent_gift
(
id
INT UNSIGNED NOT NULL AUTO_INCREMENT ,
fb_user_id
INT UNSIGNED NOT NULL ,
gift_id
INT UNSIGNE...Thankyou that worked for me! 🙂