K
Kysely15mo 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
Igal15mo 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
koskimas15mo 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
Igal15mo ago
Whenever you start importing stuff, it breaks 😢
thelinuxlich
thelinuxlich15mo ago
why you need sql.lit when using bxp? The bxp example when you hover the function shows .bxp("age","+", 1)
Igal
Igal15mo ago
I normally wouldn't, wanted to be 100% matched to the source.
wirekang
wirekang15mo 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
thelinuxlich15mo ago
Noice
Igal
Igal15mo ago
Thank you! Updated the solution's playground link.