typeorm-seeding
typeorm-seeding copied to clipboard
How to seed data with monorepo workspace in nestjs
I use monorepo to build the applications. I've some apps and libs
My code folder is below. How to write typeorm config file in my case for seeding data.

ormconfig.ts

package json seeding script

Error

The codebuild only has the main.js file. It doesn't have some file like .entity.js. So I think my ormconfig.ts file is wrong. Please help. Thanks you guys a lot.
@Sotatek-PhuongNguyen4 we are having the same issue that the lib import doesn't resolve right. Have you figured it out yet?
@weilinzung I resolved this problem by creating SeederModule and run it as application context to initialize database. In each module, I run service to insert data directly to database. I hop It's helpful for you.
@Sotatek-PhuongNguyen4 any update on this one? Have you found a solution that works together with Nest.js? Thank you!
@Sotatek-PhuongNguyen4 any update on this one? Have you found a solution that works together with Nest.js? Thank you!
@davidhoeck As I commented above, I seeded data manually by using standalone application feature. Read more: https://docs.nestjs.com/faq/serverless#using-standalone-application-feature The main idea here is call directly to database to insert datas.