Comments (11)
sequelize does have a done() promise which accepts a cb(error, result) -style callback.
from sails.
Excellent point-- I'll take a look at that! (Wish I would have looked at that close before) I actually rather like the way Sequelize handles things.
Some of the most common feedback I've had from people getting started is the initial hurdle of the mySQL dependency and a lack of Mongo support.
Maybe that's something our guys could help with in the next couple of months? I realize supporting Mongo means leaving out lots of the code around associations. We've also considered packaging Mongoose and including a flag in our models to let you choose your ORM.
Model.create(attributes).done(callback) (or generate, or add, or new)
Model.find(options).done(callback) (or read, or view, or show, or detail, or findAll)
Model.update(id,newAttrs).done(callback) (or edit, or set, or modify, or update)
Model.destroy(id).done(callback) (or delete, or remove)
from sails.
I don't have context about any of this. Sorry! I was googling for an answer to something about sequelize and came across this github issue. I then remembered that sequelize in fact does have a way to interface with node style callbacks and so replied.
from sails.
@gavri @sdepold I love sequelize, and we're going to continue using it for our framework, it's great.
We have two main needs:
- an in-memory database for getting started quickly
- MongoDB support
Is there interest in this on the Sequelize side? I'd be happy to invest some of our resources and my time in helping this happen.
from sails.
@mikermcneil wow that sounds greate ! i would pretty much appreciate mongodb support. what do u have in mind about in-memory databases?
from sails.
The in-memory db is purely for development-- doesn't have to be efficient at all. The idea is that you can get going immediately without having to configure any external database. We'd probably want to start with that, since it's a lower-hanging fruit, and would add a lot of value to our framework and Sequelize. Basically very similar to what these guys are doing: https://github.com/1602/jugglingdb
Then, for Mongo support, I'd think we'd probably want to use Mongoose or some other existing ORM under the covers and map it to Sequelize conventions. Ideally, for emulating relational support via belongsTo/hasMany/hasOne, you'd be able to configure whether associations are handed as links or enclosures, but we might start by just doing links.
We're also interested in adding support for custom mappings for models (adapters). I.e. if you want to build a model to allow CRUD access to Facebook users via the Facebook API, you could write an adapter (i.e. you write FacebookAdapter.find()
, FacebookAdapter.create()
, FacebookAdapter.updateAttributes()
, etc. Originally we had just planned to wrap Sequelize in this sort of abstraction (i.e. our MySQLAdapter, PostgresAdapter, and SQLiteAdapter would use Sequelize under the covers). But If that's something that makes sense to bring down to the ORM level, that would be great, since then it would be available for folks who aren't necessarily using Sails.
Thanks!
Mike
PS- if you have time to talk through this in more depth, it'd be great to Skype for a few minutes to get on the same page. (Ich spreche ein bisschen Deutsch, wenn das behilflich wรผrden.)
from sails.
So if you want in-memory db, why not just use SQLite ? You can either use a temporary one via "storage: ':memory:'" or a persistent one via "storage: 'path/to/sequelize.db'. See this for further information: http://sequelizejs.com/#usage-dialects
Sascha Depold
Gesendet mit Sparrow (http://www.sparrowmailapp.com/?sig)
Am Freitag, 2. November 2012 um 22:33 schrieb Mike McNeil:
The in-memory db is purely for development-- doesn't have to be efficient at all. The idea is that you can get going immediately without having to configure any external database. We'd probably want to start with that, since it's a lower-hanging fruit, and would add a lot of value to our framework and Sequelize. Basically very similar to what these guys are doing: https://github.com/1602/jugglingdb
Then, for Mongo support, I'd think we'd probably want to use Mongoose or some other existing ORM under the covers and map it to Sequelize conventions. Ideally, for emulating relational support via belongsTo/hasMany/hasOne, you'd be able to configure whether "joins" are handed as links or enclosures, but we might start by just doing links.
We're also interested in adding support for custom mappings for models (adapters). I.e. if you want to build a model to allow CRUD access to Facebook users via the Facebook API, you could write an adapter (i.e. you write FacebookAdapter.find(), FacebookAdapter.create(), FacebookAdapter.updateAttributes(), etc. Originally we had just planned to wrap Sequelize in this sort of abstraction (i.e. our MySQLAdapter, PostgresAdapter, and SQLiteAdapter would use Sequelize under the covers). But If that's something that makes sense to bring down to the ORM level, that would be great, since then it would be available for folks who aren't necessarily using Sails.
Thanks!
Mike
PS- if you have time to talk through this in more depth, it'd great to Skype for a few minutes to get on the same page.โ
Reply to this email directly or view it on GitHub (#36 (comment)).
from sails.
would be great if one could send private messages on github ^^ skype: search for sdepold :)
from sails.
@ pming on github: F'real. Ill hit you up, thanks!
Mike's phone
On Nov 6, 2012, at 1:21, Sascha Depold [email protected] wrote:
would be great if one could send private messages on github ^^ skype: search for sdepold :)
โ
Reply to this email directly or view it on GitHub.
from sails.
Closing this in favor of #71
from sails.
Its true that Sequelize's promise based interface does not fit well into the testing framework. There is a lot of jumping around and inconsistency while operating based on the callbacks for success and errors. After working with sequelize for almost 2 months then we realized we were deep into trouble. One more problem is the associations. When there are chained associations the output is not consistent. Many times we could not recreate the problems raised by the testers. Now I have taken the pain of migrating to jugglingdb. I hope that the jugglingdb guys can produce more documentation.
from sails.
Related Issues (20)
- Sails 1.5.3 version breaking due to update in ejs and async HOT 7
- Primary key value equals to 0 HOT 2
- Difficulty debugging a memory Leak HOT 5
- File Upload to S3 is super slow HOT 2
- sails-mongo maintenance and support HOT 2
- beforeCreate() model not working in bootstrap - proceed is not a function HOT 2
- Model.updateOne().set() inappropriately manipulates the valuesToSet object HOT 8
- cors issue: blocking works wrongly HOT 2
- Long string presented as array in req.body HOT 2
- Are the change log and releases managed? HOT 3
- Waterline or sails-mongo does not catch some MongoDB exceptions HOT 3
- .createEach([x, y, x]) HOT 3
- Update to express 4.17.3 HOT 2
- is this project dead? HOT 4
- Model.getDatastore().sendNativeQuery() return ?column? in rows HOT 2
- The documentation page is not responsive HOT 2
- No documentation on how to access value of wildcard route? HOT 8
- getting an error "ReferenceError: User is not defined",how to fix it HOT 2
- Can we start using Github discussions? HOT 4
- Incompatibility with MongoDB 6.0.2 HOT 33
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 sails.