K
Kysely•2y ago
Nil

how to search inside a json type column, I'm using postgresql

I looked in the documentation, and it talks about using the jsonObjectFrom function that is in the kysely lib, but I didn't find it, should I have done the function?
2 Replies
Igal (mobile)
Igal (mobile)•2y ago
Hey 👋 JSON traversal is currently being worked on, and may or may not make it to the core. https://github.com/kysely-org/kysely/pull/440
GitHub
add json traversal support. by igalklebanov · Pull Request #440 · k...
Trying to figure out what we can do, what we should do, and how this can be scoped and explained. JSON path syntax is supported by all 3 built-in dialects. So having a type-safe JSON path builder ...
koskimas
koskimas•2y ago
In the meantime you can use raw SQL or write your own helpers around that
db.selectFrom('person')
.selectAll()
.where(sql`address->postalCode`, '=', '61710')
db.selectFrom('person')
.selectAll()
.where(sql`address->postalCode`, '=', '61710')
Want results from more Discord servers?
Add your server