sqlc icon indicating copy to clipboard operation
sqlc copied to clipboard

Support multiple conflict targets in upsert statements for SQLite parser

Open maxsei opened this issue 1 year ago • 1 comments

What do you want to change?

The SQLite docs mentions that "The ON CONFLICT clauses are checked in the order specified", implying that there can be multiple conflict targets in an upsert statement which is not the case in sqlc. Currently, the SQLite parser will fail to parse queries that contain multiple conflict targets.

This gist contains the output of sqlc verify against a query, schema, and config file to demonstrate the issue.

What database engines need to be changed?

SQLite

What programming language backends need to be changed?

Go

maxsei avatar Jun 13 '24 03:06 maxsei

@maxsei — Ironically, I ran into this exact same need a few days ago. 🤷‍♂️

mikeschinkel avatar Jun 15 '24 17:06 mikeschinkel