mike
mike
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
I am using it to init core data such as postal codes, countries, currencies, etc. to push necessary data to make the application up-and-running. So I seed these data but later we want to add one new country and remove one existing country. In such a case I should delete one of the existing countries (if it exists with a delete where clause ) and then seed with onConflict clause everything again? Is this really the "right" pattern?
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
or update of course
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
you mean to use .onConflict((cb) => cb.doNothing())...? 🤷‍♂️
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
One more thing - I successfully run the seeders as follows but I it does not save the seeder in any log table as it is happening in migrations. Once the seeder has been successfully executed it should not been executed again or do I miss anything?
kysely seed run
Starting seed run
Seed successful
Ran 1 seed:
[✓] 1730819003844_seed-postal-codes
kysely seed run
Starting seed run
Seed successful
Ran 1 seed:
[✓] 1730819003844_seed-postal-codes
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
thanx. I'll take a look
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
so can you please give me a hint? a link maybe?
17 replies
KKysely
Created by mike on 11/5/2024 in #help
How to define multiple configs in a NX monorepo?
I finally did it this way (switching different settings by env variable passed before the script) as follows. Is there a way how to change naming convention from timestamp_name.ts to timestamp-name.ts...?
KYSELY_DATA_SOURCE=app1 npx kysely seed make test
KYSELY_DATA_SOURCE=app1 npx kysely seed make test
17 replies
KKysely
Created by mike on 9/30/2024 in #help
Migrator transaction (postgresql dialect)
Oh, so all the migrations are running in a one unique transaction...! From our previous discussion (few months ago) I understood each migration run in it's own migration. If all are in one transaction that's everything I need. 😍
13 replies
KKysely
Created by mike on 9/30/2024 in #help
Migrator transaction (postgresql dialect)
From the info it looks like we have to solve potential upgrade failure scenario in advanced devops flows rather than with simple successful migration transaction... correct?
13 replies
KKysely
Created by mike on 9/30/2024 in #help
Migrator transaction (postgresql dialect)
I see. Thank you
13 replies
KKysely
Created by mike on 9/30/2024 in #help
Migrator transaction (postgresql dialect)
ok. what is the kysely_migration_lock table for?
13 replies
KKysely
Created by mike on 6/3/2024 in #help
Migration to seed huge amount of data
postgresql
5 replies
KKysely
Created by mike on 6/14/2024 in #help
Creating snippets (best pratice)
wow, I will definitely look into this. thank you
11 replies
KKysely
Created by mike on 6/14/2024 in #help
Creating snippets (best pratice)
regarding the "prettier" stuff - why not 🙂 regarding where splitting can you show it on complex example?
11 replies
KKysely
Created by mike on 6/13/2024 in #help
How to order by desc using expression builder with case
I was looking for the second one 🥳 the easiest thing is mostly the hardest to do... 😱
5 replies
KKysely
Created by mike on 6/11/2024 in #help
How to like left value to right raw statement?
I am on psql dialect btw
20 replies
KKysely
Created by mike on 6/11/2024 in #help
How to like left value to right raw statement?
yeah, it fixed the issue. can you provide a link to a source explaining the SqlBool type and why/how to use it? I don't want to bother with stupid questions. I prefer to read docs and understand it.
20 replies
KKysely
Created by mike on 6/11/2024 in #help
How to like left value to right raw statement?
@Igal however after upgrade to the latest version I get following error. I checked the release history and fixed multiple deprecated things but this one is hard to identify...
.where((eb) =>
eb.or([ // // Type 'RawBuilder<unknown>' is not assignable to type 'OperandExpression<SqlBool>'. Property 'isSelectQueryBuilder' is missing in type 'RawBuilder<unknown>' but required in type 'SelectQueryBuilderExpression<Record<string, SqlBool>>'.
sql`row-sql`, // when removing this line it's ok
eb('column1', 'is', null),
])
)
.where((eb) =>
eb.or([ // // Type 'RawBuilder<unknown>' is not assignable to type 'OperandExpression<SqlBool>'. Property 'isSelectQueryBuilder' is missing in type 'RawBuilder<unknown>' but required in type 'SelectQueryBuilderExpression<Record<string, SqlBool>>'.
sql`row-sql`, // when removing this line it's ok
eb('column1', 'is', null),
])
)
20 replies
KKysely
Created by mike on 6/11/2024 in #help
How to like left value to right raw statement?
I installated the latest one and it works! thanks a lot
20 replies
KKysely
Created by mike on 6/11/2024 in #help
How to like left value to right raw statement?
❯ npm explain kysely [email protected] node_modules/kysely kysely@"^0.25.0" from the root project
20 replies