How to insert JSONB types in postgres?

I've looked at https://kysely-org.github.io/kysely/classes/InsertQueryBuilder.html#values and it's not very clear how I'd apply JSON to that column type when inserting. Do I need to create some sort of special helper like in: https://github.com/kysely-org/kysely/blob/master/site/docs/recipes/extending-kysely.md Also for the interface, do we define the field as a Record type? What if the field is optional?
GitHub
kysely/extending-kysely.md at master · kysely-org/kysely
A type-safe typescript SQL query builder. Contribute to kysely-org/kysely development by creating an account on GitHub.
InsertQueryBuilder | kysely
Documentation for kysely
8 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Theo Gravity
Theo GravityOP2y ago
Oh nice, so just feed in a normal object to the field then
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Theo Gravity
Theo GravityOP2y ago
For fetching did you have to implement the extending-kysely.md items?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Theo Gravity
Theo GravityOP2y ago
Thanks
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server