Emre
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
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
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