Kysely
First came Kysely, the type-safe query builder for TypeScript, then came people asking questions, then came the Discord server.Join if you like Kysely or have questions, or both.
JoinKysely
First came Kysely, the type-safe query builder for TypeScript, then came people asking questions, then came the Discord server.Join if you like Kysely or have questions, or both.
JoinSelect with alias helper
Dynamic case when expression
RANK() query for a leaderboard
Any way to create a partitioned table (PG)
).modifyEnd(sql` PARTITION BY HASH (user_id);`)
).modifyEnd(sql` PARTITION BY HASH (user_id);`)
I need a way to run a parameterized query as part of a Kysely transaction
query(query : string, params: unknown[]). AFAICT there is no way for me to run a parameterized query with the kysely DB instance?
Worst case scenario
, I can manually manage the pool/transactions myself and wrap the client in a Kysely object but that certainly would not be ideal......Generic Kysely Client
Custom joins (probably raw)
Select by many IDs query with order based on input
(VALUES (?),(?),...), but i don't know how to type the raw sql part so the output doesn't have any
please see https://kyse.link/tPC0N
thanks in advance...Reference proper table names when using schema prefix
schema.table, when you want to selectFrom('schema.table') the actual name that should be used to refer to the table later in the query, should be table and not schema.table. Using the complete path results in errors depending on the actual query shape.
From my understanding, when you refer to a table by its full path, adding the schema prefix, you're just referencing it, but the name that's actually saved in the query scope to refer back to it, doesn't have the schema prefix anymore.
An example would be:...MERGE INTO using arbitrary values
Transaction is necessary in the migration file?
Strange error while inserting
How can I use `->>` and `->` operators with ExpressionBuilder?
eb(ref("table.column"), "->", eb.lit("foo")), but this does not work because "->" is not recognized as a valid operator. How do I do this without using raw SQL templates?ref("table.column", "->>").key("foo").Deferrable on unique indexes and constraints
I need to extract the type of eb in the query chain
selectFrom or getExecutor not a function with custom dialect.
selectFrom or with sql.raw().execute(db)):
- selectFrom is not a function
- executorProvider.getExecutor is not a function
...Can't figure out how to add a unique index on (foo, LOWER(bar)) for a table
Using AsyncLocalStorage to Propagate Transaction Context
with-transaction.ts:
```ts...How to make general purpose queries?