Overview
One of the things that, in addition to being immensely convenient during the prototyping of an application, can also be favorab...
For further actions, you may consider blocking this person and/or reporting abuse
thanks for sharing
Nice post but a long time has passed since this it was written. So I just wrote an up-to-date one on my blog, for thoes who are in need in these times:
How to seed a database with typeorm and faker in 2023
The link does not work
Thank you for notifying, I've just updated it now.
is not working 😩
correct link is devist.xyz/posts/how-to-seed-a-dat...
Thanks for sharing😉
seeds: ["src/db/seeding/seeds//*{.ts,.js}"],
factories: ["src/db/seeding/factories//*{.ts,.js}"],
Does not work with nestjs
TypeOrmModule.forRoot({
type: process.env.DB_TYPE as any,
host: process.env.DB_HOSTNAME,
port: Number(process.env.DB_PORT),
username: process.env.DB_USERNAME,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
entities: [Book, Page],
seeds: [InitialDatabaseSeed],
factories: ['src/db/seeding/factories/**/*{.ts,.js}'],
synchronize: true,
logging: process.env.NODE_ENV !== 'production',
}),
Help me
Hi, if you run
npm run db:seed
two time, is it going to generate 30 users and 200 posts even though you have only one seed?អរគុណ😻
Thanks for sharing.. Is there a way to use this inside an Nx Monorepo ?
Thanks for sharing this articel, really help me a lot.
✖ Could not load the config file!