K
Kysely•2y ago
Igal

stock trade

query https://user-images.githubusercontent.com/103982094/228803165-415ff305-d8d7-49e2-ba93-1359bf69c74f.png please share your solutions or discuss the solutions in the comments. Kysely feedback and suggestions for enhancement are also welcome.
9 Replies
Igal
Igal•2y ago
v0.24.2 solution https://wirekang.github.io/kysely-playground/?p=f&i=-NSLNa1J1ghEtp8rCN6y using a helper function to DRY it up. using a single .where invocation, but could chain multiple invocations for the and - wanted a single eb for all.
koskimas
koskimas•2y ago
Nice! Why is that withTables needed? Didn't the DB used to get merged with the global DB type automatically in the playground?
Igal
Igal•2y ago
Whenever you start importing stuff, it breaks 😢
thelinuxlich
thelinuxlich•2y ago
why you need sql.lit when using bxp? The bxp example when you hover the function shows .bxp("age","+", 1)
Igal
Igal•2y ago
I normally wouldn't, wanted to be 100% matched to the source.
wirekang
wirekang•2y ago
Now you can import stuffs if you wrap interface DB with declare global https://wirekang.github.io/kysely-playground/?p=f&i=-NSJaFkfVUzf8Pi8gHmV
thelinuxlich
thelinuxlich•2y ago
Noice
Igal
Igal•2y ago
Thank you! Updated the solution's playground link.
Want results from more Discord servers?
Add your server