effect-kysely icon indicating copy to clipboard operation
effect-kysely copied to clipboard

how to store data in jsonb?

Open fredericrous opened this issue 1 year ago • 0 comments

great lib, thanks for sharing it! Would you be kind to provide an example on how to use it with JSONB?

  • I have a column typed jsonb in sqlite
  • I typed my effect/schema property with Schema.Object

I seem to succeed in serializing the value but idk how to decode it, effect-kysely throws

to serialize the value, I seen on kysely documentation I should cast it like so

sql`CAST(${JSON.stringify(value)} AS JSONB)`

fredericrous avatar Jul 29 '24 17:07 fredericrous