K
Kysely15mo ago
d2bayes

Consensus on immutable vs. mutable result for .executeTakeFirst

Hi folks, love Kysely, thanks for your work. Is there a consensus on whether or not the query result for executeTakeFirst should be immutable? Or is this up to the dialect/not a concern of Kysely? I'm asking because I seem to have found an inconsistency with kysely-libsql where the result of executeTakeFirst is immutable, but this isn't the case for built-in dialects (checked Sqlite and Pg). Wanted to get your thoughts on this so I can figure out if it's more appropriate to raise an issue with the dialect or if I should deal with this in a library that integrates Kysely. Thanks!
Solution:
The result is not meant to be immutable. It's up to the dialect and the underlying driver. Unless you use something like CamelCasePlugin, Kysely doesn't touch the result in any way. It just returns what the driver returns.
Jump to solution
3 Replies
Solution
koskimas
koskimas15mo ago
The result is not meant to be immutable. It's up to the dialect and the underlying driver. Unless you use something like CamelCasePlugin, Kysely doesn't touch the result in any way. It just returns what the driver returns.
koskimas
koskimas15mo ago
It seems that kysely-libsql also doesn't touch the data. The driver it uses is probably responsible The client being @libsql/hrana-client
d2bayes
d2bayesOP15mo ago
Ok, in that case, since mutability/immutability here is up to the dialect, looks like it would be more appropriate to deal with this downstream; not an issue with the dialect. Thanks 👍

Did you find this page helpful?