Using `.orderBy` in JSON
Modifying the return type of a query
DB
(via kanel-kysely), one of which is for a materialized view, and as such all columns of that view are generated as nullable. (I think that's just some Postgres weirdness, not related to kysely or kanel).
I also have a function that runs a query and selects all
from that view, and I am wondering if there is any way to modify that in kysely land so that the returned type has all of these columns as non-nullable.....$narrowType
to narrow the result type in a type-safe way....Access column type in custom plugin
transformQuery
method.
Is there a way to access the column types within our plugin? ...Unions in a loop
where array_field has enum value
ShippingMethod
table with stores
field, which is array of Store
enum...NOW() function in kysely
INSERT INTO films VALUES ('UA502', 'Bananas', 105, NOW());
I was wondering if there was anyways to achieve the same thing in kysely. Thank you 😄...issue with complied sql when doing + interval operation
camelCase plugin with a strangely named column
cl_companyID
(I'm as confused as you) and I have issues with the camelCase plugin because it thinks the name is cl_company_id
.
Is there a way around this, without renaming the column?
I was thinking maybe we could add support with some kind of lookup table with weird names for the plugin to respect....Feature/Question: Would like to execute query with Prisma.$queryRaw or $executeRaw
pg
module if i already have a query-executor and a connection with prisma. It would be nice to do something like the following:
instead of:
```
const db = new Kysely<DB>({...Kysely not calling 'init' for Driver (?)
Build a basic Kysely Plugin
Deleting multiple rows at once
Question : How do you write integration test, and avoid flakynees?
Ways to work with materialized views
kysely-codegen
but unfortunately it does not generate types for materialized views. kysely.introspect
also does not return any data for materialized views either.
My ultimate goal is to put a complex query in a materialized view (my leaderboard https://discord.com/channels/890118421587578920/1125059913551458406) and be able to do 3 things:
1. query the materialized view itself with kysely...DB
and pass that to kysely, also exclude the normal view from it since I don't need it....Postgres Full Text Search
``ts
await this.db.selectFrom("city")
.where(sql
to_tsvector('english', name) @@ to_tsquery('english', 'nas:*')`)...return sql`to_tsvector(${sql.lit('english')}, ${expr})`
return sql`to_tsvector(${sql.lit('english')}, ${expr})`
Hey, there a way to update an existing migration/table?
alterTable
alterTable
await db.schema.alterTable('users').addColumn('...')
await db.schema.alterTable('users').addColumn('...')
Does kysely convert Table names lowercase when it's building a query ?
Type of query result is {}[]
kysely-codegen
:...query
to itself was causing the issue. If I do something like this, the end result has the correct typing:
```
let queryBuilder;
...Unable to compile project with the TypeScript compiler (tsc) v.5.1.6
tsc
compiler which I rarely use (but still need sometimes nevertheless) is unable to compile because of some OnConflictBuilder
error, which is way too cryptic for me to understand.
I made a bare-minimum reproducible demo here:...How to reference the parent query when creating a subquery itself?