Skip to content

Add support for sequelize #414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
DaftMonk opened this issue Aug 3, 2014 · 23 comments
Closed

Add support for sequelize #414

DaftMonk opened this issue Aug 3, 2014 · 23 comments

Comments

@DaftMonk
Copy link
Member

DaftMonk commented Aug 3, 2014

We should be able to select between using mongodb with mongoose, or sql with sequelize.

@f2net
Copy link

f2net commented Aug 5, 2014

That would be really awesome. For complex DB structures and JOIN queries Mongo is certainly not the best choice. Thank you for your great project.

@corporationsruleyourmom

Can't wait!

@JaKXz JaKXz added this to the 2.1.0 milestone Aug 13, 2014
@JaKXz JaKXz added the major label Aug 28, 2014
@f2net
Copy link

f2net commented Oct 5, 2014

I know it is a bad question, but do you have an idea of the release timeframe for 2.1.0?
I am starting a project with a mysql backend, and I don't know if it is sensible to start with Angular-Fullstack hoping in the near release of Sequelize support.

Unfortunately now I can just offer my best effort to test the Sequelize integration.
Thank you for your great job.

@dancancro
Copy link

Cleverstack already uses Sequelize. And if everyone worked together there'd be no need to make trade-offs . Please take a minute to do this survey.

@programming-kid
Copy link

it should be not either Sequelize or mongodb but option to add both if needed , i am using Sequelize for analytics & mongo for app data.

@kriswep
Copy link

kriswep commented Oct 20, 2014

+1 on this

@sigriston
Copy link
Contributor

Is this being currently worked on?

If not, I'm thinking of submitting a PR for this in 1~2 weeks or so, would that be cool?

First question first: should we go with Sequelize 1.x or 2.x for this? I'm thinking 1.x (stable), which is what I've been using in projects, but maybe you folks know more than I do and have a really strong argument for going 2.x? I really don't know...

Next, I'm thinking the UX for this should be something along the lines of what @programming-kid describes, but let me flesh it out a bit:

  1. First you choose if you want support for either mongoose, Sequelize, or both (or neither). This will cause the proper packages to show up in package.json and the code in server/app.js and places like that to instantiate mongoose/Sequelize, load models, configs etc.
  2. Then you choose whether the default project's entities (Thing and User) are based on Sequelize or mongoose, and the generator will do the obvious and create them appropriately.
  3. Finally, when you run the endpoint generator, have either an interactive prompt or a command-line argument like --sequelize or --mongoose to choose whether you want a Sequelize or mongoose-based model.

Do the above make any sense? Let me know, & thanks all contributors for the great job on this generator.

@programming-kid
Copy link

i agree with all points proposed by @sigriston , it llooks good

@pensierinmusica
Copy link
Contributor

+1

@dotch
Copy link
Contributor

dotch commented Nov 7, 2014

+1
are you working on it @sigriston ?

i just converted a sample project to sequelize+postgres, feel free to take a look at https://github.com/dotch/angular-fullstack-sequelize-demo
i moved all the models to a seperate folder, i guess you can find a more elegant solution.
i dont think that the possibility to use mongoose and sequelize together is necessary. a simple either or would be fine for most use cases.

@sigriston
Copy link
Contributor

@dotch Yeah I started working on this about a week ago. I should have something to PR sometime next week or so.

Thanks for the help with the converted project, that's more or less where I'm at right now; currently working on ensuring 100% E2E test passes!

About the models thing, I'm going the way of keeping the model files in the API endpoint folder and then just having a main module (residing in the server folder) that imports (sequelize.import()) them one by one, explicitly by name.

@Toub
Copy link

Toub commented Nov 12, 2014

Very good news!
Multiple database support is a big step to migrate existing projects based on php/mysql to angular-fullstack.

@Toub
Copy link

Toub commented Nov 21, 2014

Hi @sigriston, any update on this issue? Did you share your current code status somewhere?
I am interested to test and review a bit the code when it is ready.

@sigriston
Copy link
Contributor

@Toub whew, I think I'm done. Check out the feature-sequelize branch of my fork sigriston/generator-angular-fullstack.
I need to play with it some more for the night, and then submit a PR tomorrow. 👍

@ralyodio
Copy link

this is a MEAN stack (Mongo)...is there any reason we should be support SQL?

@dancancro
Copy link

@chovy the most salient point I get from this is that more people are familiar with sql databases which lowers the barrier to adoption. Also, I think another strong case for SQL databases is that they can support complicated multi-record, multi-table atomic transactions, but Mongo databases can't.

@dotch
Copy link
Contributor

dotch commented Nov 25, 2014

@chovy this is a very versatile angular-fullstack generator, not specifically only MEAN-Stack.
@sigriston great work, i am currently playing around with it, i'll be giving feedback soon!

sigriston added a commit to sigriston/generator-angular-fullstack that referenced this issue Nov 26, 2014
@Awk34
Copy link
Member

Awk34 commented Dec 8, 2014

PR was merged; this should be closed, ya?

@JaKXz JaKXz closed this as completed Dec 8, 2014
@pensierinmusica
Copy link
Contributor

@DaftMonk, since this has been merged now, is there any chance it can be published to npm without having to wait for all the other things in milestone 2.1.0?

What if some of the remaining features where added in future versions, like 2.1.1 and so on? I understand the relvance of semver, but it's a pity if it ends up delaying the release of important features that are ready.

Also, is there a way to access the 'canary' branch from npm? Thanks!

@kevinawoo
Copy link
Contributor

@pensierinmusica you can generate it and use it locally by cloning it and checking out canary then doing a npm link. Yoeman will use your local version now.

@pensierinmusica
Copy link
Contributor

@kevinawoo, yep thanks, that's what I ended up doing! :)

@adamjaffeback
Copy link

@kevinawoo 👍

For the love of god, please roll this out already!

@jeffbuhrt
Copy link

@rayokota support seems to be in the main branch. I have been playing with a prototype using Postgres and it is going well. The sqlite3 build on Fedora 22 x86_64 failed to compile, but PG is great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests