Can't figure out how to add a unique index on (foo, LOWER(bar)) for a table
Using AsyncLocalStorage to Propagate Transaction Context
Joining multiple separate CTE's
union
with a subquery conditionally tho, as the result shape is already established, and union
can be added to existing builder instances, outside of chain (but also with $call
)....Is this a correct situation to use $castTo (jsonArrayFrom + Left Join)
Inconsistent Typing of NUMERIC Fields with jsonBuildObject
Date
.
What's puzzling is that this behavior isn't consistent across all data types. For instance, NUMERIC
values at the root level are returned as strings
(which is fine), but when those same values appear inside a nested JSON object, their type is inferred as number
instead. I would prefer to have NUMERIC
values inside JSON objects returned as string
to keep it consistent with how they are handled at the root level....AggregateFunctionBuilder inside a SUM
SUM(CASE WHEN IsNoShow = 0 AND IsDNA = 0 THEN 1 ELSE 0 END)
SUM(CASE WHEN IsNoShow = 0 AND IsDNA = 0 THEN 1 ELSE 0 END)
100
instead of number
for eb.lit(100)
...sql literal string in binary expression builder
"1.0"
since that means you're referencing a column named 1.0
Query result type mismatch
categoryId
to nested object built with jsonObjectFrom
or maybe it does not take related table, but copies selectFrom
table.
Why does it happen?
https://kyse.link/0sjoX...selectAll('product_category')
instead of selectAll()
in the subquery
Getting the underlying connection pool/client from a kysely wrapper
Dynamic callbackURL on login
postgres helper wrapping to_json referencing CTE?
recordToJson
) that is similar to jsonObjectFrom, but that references an existing CTE. in essence i want to be able to do something like this
```typescript
db
.selectFrom('foo')...Is it okay to repeatedly wrap a PG connection pool with kysely?
Convert record from Function call (RPC) to JSON
"(b38ed355-c2b0-4998-aff9-8c8dc429ffe5,My_Test_Key,valid,aead-det,22,\"\\\\x7067736f6469756d\",\"2025-01-19 02:09:04.392092+00\",,\"\")"
"(b38ed355-c2b0-4998-aff9-8c8dc429ffe5,My_Test_Key,valid,aead-det,22,\"\\\\x7067736f6469756d\",\"2025-01-19 02:09:04.392092+00\",,\"\")"
Generating dynamic raw query help
SELECT my_function(arg1 => 'some_value', arg2 => 123);
SELECT my_function(arg1 => 'some_value', arg2 => 123);
could not determine data type of parameter $1
cast(val("foo_col"), "text")
...Overcoming issue with `withSchema` and `forUpdate`
forUpdate
if withSchema
is used. Postgres doesn't like this and will error - I wonder if there is anything I can do short-term/now to skirt this issue that doesn't cause the typechecker to complain? Thanks!Kysely
instance. Unfortunately there's no other workaround before we fix the bug https://kyse.link/mj9c1Performance impact of "$if" ?
$if
calls to see if it helps. The impact is much smaller now than it was when I wrote that doc.How can I join 2 tables where 1 side is a JSON property in a JSON column?
2-Way transforming of types