Git Product home page Git Product logo

sequelize-singleton's People

Contributors

hachichaud avatar jspizziri avatar

Stargazers

 avatar

Watchers

 avatar

sequelize-singleton's Issues

dive issue

i think, dive have error:

dive(path, action); // Dive into the directory -> dive(path, action, matcher); // Dive into the directory

Custom logger function

Thanks for putting this together. This is a helpful library.

I have an enhancement request. Can you allow db.logger to be a function? That way a custom logging function could be passed in rather than console.log, just like Sequelize.

Multiple databases?

Is it possible to make this work with multiple databases if not how you would suggest that this can be implemented?

Peer [email protected] wants sequelize@~2.0

Hi jspizziri,

Is it possible you can change your package.json to include all versions of sequelize >= 2.0? I'd like to give this a package a try with more recent versions of sequelize. This is the error I receive when trying to install sequelize-singleton with [email protected]:

npm ERR! peerinvalid The package sequelize does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants sequelize@~2.0

If possible, please update the peerDependencies in your package.json:

"peerDependencies": {
    "sequelize": ">=2.0"
},

Accessing models

// somefile.js

var orm       = require('sequelize-singleton');
var sequelize = orm.sequelize;
var Sequelize = orm.Sequelize;
var models    = orm.models;
var User      = models.User;

In your example, you seem to be able to retrieve a model from anywhere.
However, if you do that while connect has not been called already, then you're screwed because your models variable will be empty at first.
This means you cannot require your singleton and get your models if it's not already connected.

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.