Support for upsert
See original GitHub issueIt would be cool if SQLDelight would support the upsert command: https://www.sqlite.org/lang_UPSERT.html
Right now the following sql:
upsert:
INSERT INTO stop (id, address_id, name)
VALUES (?, ?, ?) ON CONFLICT(address_id) DO UPDATE SET name=excluded.name;
will produce this error:
',' expected, got 'ON'
62 INSERT INTO stop (id, address_id, name)
63 VALUES (?, ?, ?) ON CONFLICT(address_id) DO
^^
Issue Analytics
- State:
- Created 4 years ago
- Reactions:7
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Upsert in SQL: What is an upsert, and when should you use ...
The UPSERT command in CockroachDB performs an upsert based on the uniqueness of the primary key column or columns, and it will perform...
Read more >UPSERT - PostgreSQL wiki
"UPSERT" is a DBMS feature that allows a DML statement's author to atomically either insert a row, or on the basis of the...
Read more >PostgreSQL Upsert Using INSERT ON CONFLICT statement
This tutorial shows you how to use the PostgreSQL upsert feature to insert or update data if the row that is being inserted...
Read more >How to UPSERT (MERGE, INSERT ... ON DUPLICATE ...
1. In the bulk upsert, is there possible value in deleting from newvals rather than filtering the INSERT? · 1. There are still...
Read more >How to Add Upsert Support to Your API - Tyk.io
An upsert is an insert statement augmented with additional logic that ensures the new row will be updated if it already exists.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yea definitely, my hope is that we can allow specifying the minimum version of sqlite you’ll be using which would enable newer language features
It goes inside your database block:
sqldelight { MyDatabase { dialect = “sqlite:3.24: } }