Theo Gravity
Explore posts from serversHow to translate the WITH keyword in postgres when SELECT does not have FROM?
I'm trying to translate the following postgres function into pure Kysley:
I'm able to translate the main select body:
But I'm not sure how to translate the WITH part:
9 replies
Using Postgres function in an insert with a field as a select
I'm trying to translate the following SQL:
to:
It doesn't seem to like
[document.text_content, '. ']
and where('sentence')
. It seems the array value has to be a ReferenceExpression
type, but the documentation isn't very clear on what that is.20 replies
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?12 replies