mike
How to define multiple configs in a NX monorepo?
Hi, we have multiple applications in a NX monorepo and I need separate configs for migrations and seeders. How would you recommend to do it? When using
kysely init
it creates the kysely.config.ts in the root ./config. Should I use conditional app selection by env variables?17 replies
Migrator transaction (postgresql dialect)
Hello everyone,
will the code below ensure all migrations are in a single transaction? if kysely migrations don't support AsyncLocalStorage, does it make sense to use unmanaged transaction and put
BEGIN
before and COMMIT
at the end?
13 replies
How to order by desc using expression builder with case
I am ordering by using case but cannot find a way how to add
desc
to the eb.
https://old.kyse.link/?p=s&i=E4Hpv78UML4e6YqZoY6u5 replies
Migration to seed huge amount of data
Hi, are there any guides or suggestions how to effectively seed huge amount of data with migrations? We have the data in separate json (or csv) files which are copied to "assets" folder in the dist folder. How do you do this?
5 replies
Custom Plugin to transform Alias.* to "Alias.Column1", "Alias.Column2", etc.
Hi everyone, in the previous question, I asked how to transform the following syntax into a new one. I was adviced to create my own plugin serializer (example: https://github.com/subframe7536/kysely-sqlite-tools/tree/master/packages/plugin-serialize). However, I still struggle with how to do it. Can anybody please give me a hint? I'll do it later by myself but need a guide how to start.
Thank you very much!
input syntax:
required result:
12 replies
Snippet compilation
Hi, is it somehow possible to get only part of the compiled code to use it as snippet in ORM? Or vice-versa is it possible to build only part of the code with type helpers and compile them without the parent query?
For example I would like to get only the code for the header_index and header_order aliases:
6 replies
Partial compile
Hello everyone, is it possible (somehow) to generate only part of the compiled query? I have an edge-case when want to use only part ("where" statement in my case) of the compiled query from kysely. Is there any short-way to do it? I definitely don't want to parse the result. Thanks Mike
11 replies
How to work with json columns?
There are so many different sources in the documentation as those made me confused completely. I used documented way but still get errors:
https://kyse.link/H3MKN
6 replies
How to plugin column aliases with table prefix?
I am not familiar with kysely plugin creation. I am also not sure if my issue can be done with such a plugin. My aim is to have overload method like this:
so the resulted query will be:
would it be possible with plugins or any other (even existing) solution in kysely?
Thank you
7 replies
Zero number omitted from parameters
I looks like the compile() works incorrectly with zero number when used as parameter - the parameter is omitted from the array of sql components.
Not included in sql params:
Included (workaround) in the params:
5 replies
bool_or
Hi, How to use bool_or ? I am using it in case-when-then construction.
https://www.postgresql.org/docs/8.4/functions-aggregate.html
3 replies
Is there a plan to add "NULLS NOT DISTINCT" (postgresql v15) option to unique constraints/indexes?
In postgresql version 15.0 "NULLS NOT DISTINCT" statement was introduced. How to include this statement? BTW in version 16 it was disallowed for primary keys.
4 replies
Migrations in transaction and self management
Hi, I have a questions regarding migrations:
- Is it possible to run all migrations in one transaction?
- If I want to use kysely migrations for only generating raw sql for another db migration framework (such as umzug), should I use compile()?
- How to handle deprecated models? If I remove a column from a model how will this be supported by the typing?
Thanks in advance
Mike
6 replies