Emre
Emre
KKysely
Created by Emre on 10/19/2023 in #help
Type inference of queries with expressions in Webstorm
How is that proof? The playground does not provide type information.
11 replies
KKysely
Created by Emre on 10/19/2023 in #help
Type inference of queries with expressions in Webstorm
@Igal I reported this to kysely too but you locked the thread with the label "works as intended". I believe it was too soon to say that. In any case, other users now will not know what to do. https://github.com/kysely-org/kysely/issues/738
11 replies
KKysely
Created by Emre on 10/19/2023 in #help
Type inference of queries with expressions in Webstorm
Indeed. I've reported it to Jetbrains, and they have duplicated the error: https://youtrack.jetbrains.com/issue/WEB-63454
11 replies
KKysely
Created by Emre on 10/19/2023 in #help
How to compose functions?
I needed to alias the return: .select(({ eb }) => eb(eb.fn.count('id'), '>', 0).as('email_exists')) I learned this by accidentally stumbling across this note in the documentation:
You can select arbitrary expression including subqueries and raw sql snippets. When you do that, you need to give a name for the selections using the as method.
https://kysely-org.github.io/kysely-apidoc/interfaces/SelectQueryBuilder.html The error message gave no useful hints.
3 replies