stock trade

IIgal4/5/2023
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.
IIgal4/5/2023
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.
Kkoskimas4/5/2023
Nice! Why is that withTables needed? Didn't the DB used to get merged with the global DB type automatically in the playground?
IIgal4/5/2023
Whenever you start importing stuff, it breaks 😢
Tthelinuxlich4/5/2023
why you need sql.lit when using bxp? The bxp example when you hover the function shows .bxp("age","+", 1)
IIgal4/5/2023
I normally wouldn't, wanted to be 100% matched to the source.
Wwirekang4/6/2023
Now you can import stuffs if you wrap interface DB with declare global
Tthelinuxlich4/6/2023
Noice
IIgal4/6/2023
Thank you! Updated the solution's playground link.