Giter Club home page Giter Club logo

Comments (20)

MrMaz avatar MrMaz commented on September 27, 2024 6

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.

Hyra10 avatar Hyra10 commented on September 27, 2024 1

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.

tada5hi avatar tada5hi commented on September 27, 2024 1

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.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

MrMaz avatar MrMaz commented on September 27, 2024

@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.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

MrMaz avatar MrMaz commented on September 27, 2024

@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.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

DaggerJackfast avatar DaggerJackfast commented on September 27, 2024

Hello everyone, has any updates on the issue?

from typeorm-seeding.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

dbpolito avatar dbpolito commented on September 27, 2024

@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.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

sergiuchilat avatar sergiuchilat commented on September 27, 2024

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.

flowluap avatar flowluap commented on September 27, 2024

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.

MrMaz avatar MrMaz commented on September 27, 2024

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.

flowluap avatar flowluap commented on September 27, 2024

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.

MrMaz avatar MrMaz commented on September 27, 2024

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.

conceptadev#4

from typeorm-seeding.

jorgebodega avatar jorgebodega commented on September 27, 2024

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.

apudiu avatar apudiu commented on September 27, 2024

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.

apudiu avatar apudiu commented on September 27, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.