Comments (20)
My company has created a fork that is a combination of this project and v3.2.0 on the Jorge Bodega fork. We decided to go in a different direction with the API and how to do TypeORM 0.3 support.
This is not a drop in replacement, but if you need TypeORM v0.3 support you can start using it immediately with some small changes.
https://github.com/conceptadev/typeorm-seeding
from typeorm-seeding.
I tried upgrading Typeorm to 0.3.7
and typeorm-seeding threw an error saying
Cannot find module 'typeorm/driver/aurora-data-api/AuroraDataApiConnectionOptions' or its corresponding type declarations.
I guess this has something to do when upgrading to 0.3
from typeorm-seeding.
You can also give https://github.com/tada5hi/typeorm-extension a try. Recently i added seeding support, which is highly inspired by this library and the usage should be the same like before.
@jorgebodega the library could also be interesting for you, to use the singleton state management for your reimplementation https://www.npmjs.com/package/typeorm-extension#instances
from typeorm-seeding.
Oh, nice!
What are the differences? I'm still working on supporting 0.3 but I'm a bit stuck. Would be great to have some new ideas.
Also, @mehedi-iitdu as you can see on #201 I cannot automate deploy of versions, and I don't have time for taking care of this library and manually deploy new versions.
from typeorm-seeding.
@jorgebodega your idea with the factorized attributes for version 4 is really cool and i tried to make it work, but for our case is a bit too difficult to debug unit tests, and also would require too much refactoring on our projects. we are addicted to the map
i guessing, lol.
we are instead creating an "overrides api" for entity customization and sub-factories at run time. having factories and seeders that are re-useable is a high priority for us. we are re-using your seeder tree pattern with some minor tweaks.
TypeORM v0.3 support was tricky because they basically dropped support for connection name and ormconfig file. if you look at our source you can see how we basically do that from scratch now without relying on the TypeORM config options loader at all.
would love to collaborate with you more on this. i believe both seeder styles have a place.
from typeorm-seeding.
The most painful part of upgrading TypeORM is the connection refactor, that is true, and I really don't like how the Seeder actually work, like a tree, so I'm really open to any idea on how to improve that.
from typeorm-seeding.
@jorgebodega i like the tree, but not that we are forced to have one root. i am going to make a change on our fork where it runs all seeders in order by default, unless you supply one or more root seeders, it will run those each like a tree.
from typeorm-seeding.
My idea for the next version is just to remove the tree and run all the seeders in order, letting the users to choose the order with 01-Seeder
or 01Seeder
or something like.
This is just I don't like the idea of run seeders as a side effect of running others, and how that could affect to testing and execution.
Do you use the seeder with some root as entry? Every feedback is welcome
from typeorm-seeding.
Hello everyone, has any updates on the issue?
from typeorm-seeding.
No plans to work on this since I can work on this but cannot deploy.
If you can wait until someone came back to work or give me access, it's ok. But I released every change I did on another library, @jorgebodega/typeorm-seeding
from typeorm-seeding.
@jorgebodega looking at this comment #201 (comment) it seems you now have maintenance over the npm repo...
is there anything else blocking you that someone can assist? Or really depends on the author?
from typeorm-seeding.
I don't have permissions to add secrets to github, so I cannot add the deploy system I've worked on my fork, and I won't do it manually.
So until I have admin access, I won't work on this. If you need recent support, try to work with the latest version of my fork.
from typeorm-seeding.
Hi.
Also have this problem.
When running config, everything is ok.
But when run seeding I got an error MissingDriverError: Wrong driver: "undefined" given.
from typeorm-seeding.
Our company also maintains a fork of typeorm-seeding but with context support, that has been very important for us. Currently typeorm 0.3.12 is supported. https://github.com/paralo-official/typeorm-seeding
from typeorm-seeding.
Our company also maintains a fork of typeorm-seeding but with context support, that has been very important for us. Currently typeorm 0.3.12 is supported. https://github.com/paralo-official/typeorm-seeding
Hi Paul. Let me know if you want to collaborate on this fork.
from typeorm-seeding.
Our company also maintains a fork of typeorm-seeding but with context support, that has been very important for us. Currently typeorm 0.3.12 is supported. https://github.com/paralo-official/typeorm-seeding
Hi Paul. Let me know if you want to collaborate on this fork.
Definitely interested. jorgebodega also has a fork I think. We should put our efforts into one fork I think...
For us the context has been very important.
What do you think on this?
from typeorm-seeding.
Our company also maintains a fork of typeorm-seeding but with context support, that has been very important for us. Currently typeorm 0.3.12 is supported. https://github.com/paralo-official/typeorm-seeding
Hi Paul. Let me know if you want to collaborate on this fork.
Definitely interested. jorgebodega also has a fork I think. We should put our efforts into one fork I think... For us the context has been very important. What do you think on this?
Yes I like the idea of adding the context back. Ours is a fork of Jorge's project, but we decided to go in a slightly different direction and set context aside for later. I just created a thread on our repo so we can have the discussion there.
from typeorm-seeding.
I have a fork just to have a functional version of the code, but there are some changes, context is the main one, just because I don't see why it should stay in my version with the changes.
If you want to add me in the discussion, just ping me.
from typeorm-seeding.
Our company also maintains a fork of typeorm-seeding but with context support, that has been very important for us. Currently typeorm 0.3.12 is supported. https://github.com/paralo-official/typeorm-seeding
Thank you for making the lib compatible with typeORM 0.3.x
I've followed the instructions on https://github.com/paralo-official/typeorm-seeding/blob/main/README.md
After running npm run seed:run
I'm getting following error```
✔ Seeding Config seeding-source.js loaded
✖ Could not load the seeding source config file at seeding-source.js! Orginal error was: seedingSource.initialize is not a function
Could not load the seeding source config file at seeding-source.js! Orginal error was: seedingSource.initialize is not a function
scripts
in package.json
"seed:config": "typeorm-seeding config -r ./dist/db -c seeding-source.js",
"seed:run": "typeorm-seeding seed -r ./dist/db -c seeding-source.js"
my folder structure (in project root)
db
factories
seeders
seeding-source.ts
Please help me understand what's wrong here.
from typeorm-seeding.
I've found the solution, I think the docs need a little improvement. As the docs suggested, I've created SeedingSource
class but that needs to be imported from the package. This part also confuses me how does this work!!, Now seeding OK
// result of misleading doc's, need to import this class from package <<
// class SeedingSource {
// constructor(public options: SeedingSourceOptions) {}
// }
export default new SeedingSource({
dataSource: DataSource,
seeders: [UserSeeder],
// defaultSeeders: [UserSeeder],
});
from typeorm-seeding.
Related Issues (20)
- update major faker version please HOT 1
- Faker npm package not supported HOT 1
- Faker got abandoned and NPM audit complains about it HOT 1
- TypeError: Cannot read properties of undefined(reading 'number') HOT 3
- Support [email protected] HOT 2
- how to truncate tables? HOT 1
- There is a typo for the shebang in the dist/cli.js HOT 1
- Example for how to seed ManyToMany relation HOT 1
- [Request] Support for typeorm 0.3 and nestjs/typeorm v8.1.0 HOT 1
- Database connection failed! Check your typeORM config file. MissingDriverError: Wrong driver: "undefined" given. HOT 4
- this.subQuery is not a function HOT 1
- Replace `faker` with `@faker-js/faker` HOT 2
- Hello. I just have a question HOT 1
- TypeError: Cannot read properties of undefined (reading 'name')
- prevent seed:config to log any output
- How to seed data with monorepo workspace in nestjs HOT 4
- unable to resolve dependency tree HOT 8
- Publish 1.6.2 HOT 2
- Doesn't finish command
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typeorm-seeding.