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.
Igal
Igal•409d 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•409d 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•409d ago
Whenever you start importing stuff, it breaks 😢
thelinuxlich
thelinuxlich•409d ago
why you need sql.lit when using bxp? The bxp example when you hover the function shows .bxp("age","+", 1)
Igal
Igal•409d ago
I normally wouldn't, wanted to be 100% matched to the source.
wirekang
wirekang•409d 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•409d ago
Noice
Igal
Igal•408d ago
Thank you! Updated the solution's playground link.
Want results from more Discord servers?
Add your server
More Posts
Trouble running migrationsI am trying to use Kysely on a svelte-kit project, I set up the migration script like the example shSuggestions on implementing SQLite as DocumentDB or GraphDNWould love recommendations on using Kysely to implement something similar to the following. https://open source examplesDo you know of a mid-large size open source codebase that has integrated kysely? Size isn’t most imTypes for use with leftJoinHiya! I'm attempting to do a leftJoin and return the result: ``` const result = await db .selmysql InsertResult always emptymy app is heavy id/transaction user and i need the id of created register to insert another registerRawBuilder is not "Compilable"How one should execute RawBuilders coming from (for example) ```sql`customsql` ``` since they're noQuery with ANDs and ORs - struggling with syntaxI want to be able to create a query that looks like this - i.e. has a first WHERE section that musSubquery type error when using genericsI have the following simple query being generated by my function `f`: ```typescript const f = () => Extacting where clause generation into dedicated functionI'm building up a query dynamically and need to use some of the logic embedded in where clauses fromcreateQueryIdIs this function supposed to be exported and used in users code? I'm handling query execution with aWeird importing error on latest Kysely 0.23.5When I try to import Insertable:Insert expression type safeIs there a way to make `.expression` calls while inserting to a table to return an "InsertObject" orProperty "values" missing when Inspecting InsertQuery ValuesNodeI'm having some troubles upgrading from 0.22.0 to 0.23.4, because I have a custom plugin which gets How to make a top level SELECT that isn't from a table?I'm trying to combine two queries, `SELECT COUNT(*) FROM A` and `SELECT COUNT(*) FROM B`. `SELECT (