On Conflict do update set ALL to be inserted columns

Here I am once again with a question for the on conflict bit in postgres. Would there be a way to automatically compose an update set statement for the on conflict do update bit with the information about all the columns we're going to insert, and automatically do an update with the excluded for those? Example here
2 Replies
Kristian Notari
Kristian NotariOP9mo ago
Maybe by adding a doUpdateSetAllFromExcluded
koskimas
koskimas9mo ago
There's no such feature in SQL, and thus I'm very hesitant to add something like that. Kysely provides a 1-1 mapping to SQL (as close as possible). where creates a where statement, select a select statement and so on. The only place where we've diverged from that principle is the transaction API. Of course in some places, the API is pretty far from the corresponding SQL just because it was difficult to make a better mapping between TS and SQL. But this wouldn't be a bad mapping to an existing SQL feature. This would be new feature built on top of SQL. We have such stuff in the helpers sub packages though, but not in the core. This wouldn't really fit there either as this would need to be a method.
Want results from more Discord servers?
Add your server