Issue Getting TypeScript to work with nested query
Hi there 👋 . I'm experiencing an issue with getting typescript to play nice with Kysely. I should add that I'm still a newbie to Kysely and typescript in general.
Here's the code:
Here's the expected sql code
But I keep getting this error with the typescript code above:
7 Replies
here's the screenshot of the code
That particular query is cleanest when you just use raw sql for the selections
https://kyse.link/?p=s&i=q01BOoZU4VnOd28lWqrQ
But that query seems a bit odd.
count
will always be equal to the limit
parameter's value, in this case 20okay
I don't actually know too much sql
is there a better way of writing it?
I want to get a list of rows based on an
offset
and limit
and also get the total number of rows in the table
is it possible?
thanks for thisWhich dialect are you using?
I'm guessing postgres from the
json_agg(table)
syntax
I'd do something like this https://kyse.link/?p=s&i=vXniPbSUVtN4mUuUxSouyeah
thanks so much for this 😁
how do I mark this post as solved 🥲
Three dots --> Apps --> Mark solution
Okay
Thanks