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?11 Replies
Hey š
The configuration supports envrionment-specific overrides.
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
...?
not what I meant
so can you please give me a hint? a link maybe?
GitHub
GitHub - unjs/c12: āļø Smart Configuration Loader
āļø Smart Configuration Loader. Contribute to unjs/c12 development by creating an account on GitHub.
thanx. I'll take a look
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?
yeah
that's how seeds work in knex iirc
e.g. your seed file might be some non-deterministic code. there should not be anything stopping you from running it again, at least by default
you mean to use
.onConflict((cb) => cb.doNothing())
...? š¤·āāļø
or update of coursee.g. you're using faker to generate 100 users
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?what database are you using?