How to narrow type from jsonArrayFrom
Hey! I need to narrow some types from table that works as
Single Table Inheritance
table. I believe this is possible, but after some fighting with api and syntax I am not sure how to make it.
Here is my query:
(sorry for polish, Ubiquitous Language with domain masters)
Solution:Jump to solution
oh okey got it,
.$narrowType<PrzyjecieZewnetrznePozycjaRozbicieSelect>()
has to be straight after jsonArrayFrom
not at the top level3 Replies
I tried with: https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html#_narrowType and https://kysely-org.github.io/kysely-apidoc/classes/ExpressionWrapper.html#_castTo
ExpressionWrapper | kysely
Documentation for kysely
SelectQueryBuilder | kysely
Documentation for kysely
any hint is enough for me, please don't waste your time to change the above query
Solution
oh okey got it,
.$narrowType<PrzyjecieZewnetrznePozycjaRozbicieSelect>()
has to be straight after jsonArrayFrom
not at the top level