jpayne
jpayne
KKysely
Created by jpayne on 11/15/2023 in #help
`update set from`
Accroding to @koskimas, kysely supports the update set from sql syntax. So far, I've been unable to figure out how (in lieu of dropping down to raw sql). We are planning to craft many of our update statements as batch operations in our repository layer, so this pattern will be used heavily. Here's some example sql to make it clear (hopefully) what I'm trying to do
update test as t set
column_a = c.column_a
from (values
('123', 1),
('345', 2)
) as c(column_b, column_a)
where c.column_b = t.column_b;
update test as t set
column_a = c.column_a
from (values
('123', 1),
('345', 2)
) as c(column_b, column_a)
where c.column_b = t.column_b;
Reference: https://github.com/kysely-org/kysely/issues/677#issuecomment-1707741394
9 replies
KKysely
Created by jpayne on 3/29/2023 in #help
open source examples
Do you know of a mid-large size open source codebase that has integrated kysely? Size isn’t most important here, but I’m curious to see edge cases and sophisticated use cases may arise in a sufficiently complex system.
7 replies