How to narrow type in select
company, person
to just person
in select query?
```
const results = await db
.selectFrom('receiver')
.where('type', '=', 'person')...$narrowType
Subquery from a function
boolean
. It's { is_friend: boolean }
. Yes, you can use that as a scalar in SQL and Kysely does handle that correctly. But don't explicitly set the wrong type.
You always need to provide a name for selections using the as
method. The name is dialect-specific if you leave it out. Since kysely types don't know which dialect you're using, providing a name for that column automatically is impossible....why is WhereNode.where any operation node?
are nested joins supported?
knex .select('*') .from('users') .join('accounts', function () { this.on(function () { this.on('accounts.id', '=', 'users.account_id'); this.orOn('accounts.owner_id', '=', 'users.id'); }); });
knex .select('*') .from('users') .join('accounts', function () { this.on(function () { this.on('accounts.id', '=', 'users.account_id'); this.orOn('accounts.owner_id', '=', 'users.id'); }); });
New dialect for snowflake - quotes and case sensitivity
Help with implementation of new dialect for snowflake
DefaultQueryCompiler
There are several things that snowflake does not support, such as indices....is there any helper to put all columns in json_build_object?
Advice for debugging timeout/connection issues with Kysely
Is it possible to change type of returned value with jsonBuildObject?
'wartosc'
as string
but actually it returns number
. Can't simply change zod reponse schema, cuz kysely types wartosc
in query is as string, and there is type mismatch anyway. (sorry for polish, ubiquitous language with polish domain masters)
```
jsonBuildObject({
id: eb.ref('domyslnaStawkaVatSprzedazy.id'),
nazwa: eb.ref('domyslnaStawkaVatSprzedazy.nazwa'),...Is it possible to configure to which types database columns are introspected?
int id
is introspected to Generated<number>
(we would like number type) or decimals
are introspected to Numeric
(we would like just number)How to infer an aggregated column with `filterWhere` clause as nullable?
leftJoin
, then grouping rows by id, and finally using jsonAgg(jsonBuildObject(...))
with a filterWhere
method chained on top of this expression as seen in the demo.
The problem is that the inferred type by kysely is incorrect, because it thinks the json aggregate function will always be an array, however, if there are no matching rows from the other table it will be NULL because of the filter where clause....Accessing underlying methods on the client
Kysely
class itself, or if it is necessary for me to write my own extension of the class to achieve thisHow to do `LIKE ANY` query in Kysely?
ANY
into the query.
```sql
SELECT *
FROM your_table
WHERE your_column LIKE ANY (ARRAY[...Creating snippets (best pratice)
How to order by desc using expression builder with case
desc
to the eb.
```ts
const person = await db
.selectFrom("person")...Is it possible to do "for await (const iterator of db.selectFrom("table").selectAll()) {....}
Question about ColumnTypes and dates.
DATE
(yyyy-mm-dd).
```sql
CREATE TABLE IF NOT EXISTS person(
id INT NOT NULL,...ColumnType
which would be used in where
statements (and other similar statements).
But then subqueries in where
statements would break if the select type and the query type don't match....How to type tables with dynamic names?
.withTables
and in the queries, and implement a plugin that on-the-fly adds the random suffix to all references to that table....Any limits on insertValues(array)?