GithubHelp home page GithubHelp logo

aichholzer / modellr Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 200 KB

Database connection manager for Sequelize.

License: MIT License

JavaScript 100.00%
sequelize manager database-management database-connection models database-schemas

modellr's Introduction

modellr

Greenkeeper badge npm version Build Status Downloads

Database connection manager for Sequelize.
modellr will also load your models and map them to the DB instance, making them available throughout your application.

Install

$> npm i modellr

Basic example

const m = require('modellr');
const config = {
  database: 'database',
  username: 'username',
  password: 'password',
  dialect: 'postgres',
  logging: false
}

m.load(config, './models/').then(() => {
  // Start your application.
  // You have a persisted DB connection.
});

Have a look at the models in test/models to see how they should be defined.

Usage

You models are available throughout your application, simply require modellr and access whatever model you need.

If, for example, you have a model named User, you may use it like so:

const m = require('modellr');

m.User.findById(123).then((user) => {
  // "user" is your record.
});

All models export the basic Sequelize usage/functionality as documented here.

API

.load(config, models) : Prepare the DB connections (as Sequelize instance) and load all model definitions. Note that this method will read all model definitions files, thus it should only be called once, at application launch.

.instance(alias || null) : Use a particular instance. If the argument is null then the first valid instance will be used.

.close(alias || null) : Close DB connections and terminate the corresponding Sequelize instance. If the argument is null then all open connections will be terminated.

Test

$> npm test

Contribute

fork https://github.com/aichholzer/modellr

License

MIT

modellr's People

Contributors

aichholzer avatar greenkeeper[bot] avatar snyk-bot avatar

Stargazers

 avatar  avatar

Watchers

 avatar

modellr's Issues

An in-range update of prettier is breaking the build ๐Ÿšจ

The devDependency prettier was updated from 1.18.2 to 1.19.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for Prettier 1.19: Long awaited Vue option, TypeScript 3.7 and new JavaScript features

diff

๐Ÿ”— Release Notes

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of mocha is breaking the build ๐Ÿšจ

The devDependency mocha was updated from 6.1.4 to 6.2.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

mocha is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v6.2.0

6.2.0 / 2019-07-18

๐ŸŽ‰ Enhancements

๐Ÿ› Fixes

๐Ÿ“– Documentation

๐Ÿ” Coverage

๐Ÿ”ฉ Other

Commits

The new version differs by 39 commits.

  • bd47776 Release v6.2.0
  • cc595af update CHANGELOG.md for v6.2.0 [ci skip]
  • 59d70ee fix: remove duplicate line-height property (#3957)
  • f77cac4 fix: do not redeclare variable (#3956)
  • 6201e42 Hide stacktrace when cli args are missing (#3963)
  • 88f45d5 Don't re-initialize grep option on watch re-run (#3960)
  • 5d4dd98 Fix No Files error when file is passed via --files (#3942)
  • 15b96af Collect test files later (#3953)
  • ccee5f1 Base reporter store ref to console.log (#3725)
  • 47318a7 update @mocha/contributors to v1.0.4 (#3944)
  • c903147 More, improved integration tests for watching (#3929)
  • e341ea4 Update CI config files to use Node-12.x (#3919)
  • 3064d25 update @mocha/docdash to v2.1.1 (#3945)
  • 9ea45e7 do not fork if no node flags present (#3827)
  • d02a096 modify Mocha constructor to accept options.global or options.globals (#3914)

There are 39 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of coveralls is breaking the build ๐Ÿšจ

The devDependency coveralls was updated from 3.0.5 to 3.0.6.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

coveralls is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 3 commits.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of eslint is breaking the build ๐Ÿšจ

The devDependency eslint was updated from 6.0.1 to 6.1.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v6.1.0
  • 8f86cca Upgrade: eslint-scope@^5.0.0 (#12011) (Kevin Partington)
  • d08683e Fix: glob processing (fixes #11940) (#11986) (Toru Nagashima)
  • bfcf8b2 Fix: dot-location errors with parenthesized objects (fixes #11868) (#11933) (Milos Djermanovic)
  • 79e8d09 Fix: add parens for sequence expr in arrow-body-style (fixes #11917) (#11918) (Pig Fang)
  • 105c098 Docs: update docs for object-curly-spacing (fixes #11634) (#12009) (Chiawen Chen)
  • c90a12c Chore: update release script for new website repo (#12006) (Kai Cataldo)
  • e2c08a9 Sponsors: Sync README with website (ESLint Jenkins)
  • b974fcb Update: Check computed property keys in no-extra-parens (#11952) (Milos Djermanovic)
  • 222d27c Update: Add for-in and for-of checks for props in no-param-reassign (#11941) (Milos Djermanovic)
  • e4c450f Fix: no-extra-parens autofix with in in a for-loop init (fixes #11706) (#11848) (Milos Djermanovic)
  • 2dafe2d Fix: prefer-const produces invalid autofix (fixes #11699) (#11827) (Milos Djermanovic)
  • cb475fd Fix: Cache file error handling on read-only file system. (fixes #11945) (#11946) (Cuki)
  • 89412c3 Docs: Fixed a typo (fixes #11999) (#12000) (Eddie Olson)
  • 6669f78 Fix: --init with Vue.js failed (fixes #11970) (#11985) (Toru Nagashima)
  • 93633c2 Upgrade: Upgrade lodash dependency (fixes #11992) (#11994) (Cyd La Luz)
  • 776dae7 Docs: fix wrong Node.js version in getting started (#11993) (Toru Nagashima)
  • 4448261 Docs: some typos and optimization points (#11960) (Jason Lee)
  • 2a10856 Chore: Add temporary test files to .gitignore (#11978) (Milos Djermanovic)
  • d83b233 Chore: update path for release bundles (#11977) (Kai Cataldo)
  • 1fb3620 Fix: creating of enabledGlobals object without prototype (fixes #11929) (#11935) (finico)
  • c2f2db9 Docs: Replace global true and false with writable and readonly in rules (#11956) (Milos Djermanovic)
  • 19335b8 Fix: actual messageId and expected messageId are switched in rule tester (#11928) (Milos Djermanovic)
  • 8b216e0 Docs: Fix incorrect example comments for unicode-bom rule (fixes #11937) (#11938) (Brandon Yeager)
  • cc3885b Chore: add v8-compile-cache to speed up instantiation time (#11921) (่–›ๅฎš่ฐ”็š„็Œซ)
  • d8f2688 Upgrade: deps (#11904) (่–›ๅฎš่ฐ”็š„็Œซ)
  • e5f1ccc Docs: add 'stricter rule config validating' in migrating docs (#11905) (่–›ๅฎš่ฐ”็š„็Œซ)
Commits

The new version differs by 28 commits.

  • 02d7542 6.1.0
  • 5997f7a Build: changelog update for 6.1.0
  • 8f86cca Upgrade: eslint-scope@^5.0.0 (#12011)
  • d08683e Fix: glob processing (fixes #11940) (#11986)
  • bfcf8b2 Fix: dot-location errors with parenthesized objects (fixes #11868) (#11933)
  • 79e8d09 Fix: add parens for sequence expr in arrow-body-style (fixes #11917) (#11918)
  • 105c098 Docs: update docs for object-curly-spacing (fixes #11634) (#12009)
  • c90a12c Chore: update release script for new website repo (#12006)
  • e2c08a9 Sponsors: Sync README with website
  • b974fcb Update: Check computed property keys in no-extra-parens (#11952)
  • 222d27c Update: Add for-in and for-of checks for props in no-param-reassign (#11941)
  • e4c450f Fix: no-extra-parens autofix with in in a for-loop init (fixes #11706) (#11848)
  • 2dafe2d Fix: prefer-const produces invalid autofix (fixes #11699) (#11827)
  • cb475fd Fix: Cache file error handling on read-only file system. (fixes #11945) (#11946)
  • 89412c3 Docs: Fixed a typo (fixes #11999) (#12000)

There are 28 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of prettier is breaking the build ๐Ÿšจ

Version 1.13.0 of prettier was just published.

Branch Build failing ๐Ÿšจ
Dependency prettier
Current Version 1.12.1
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push The Travis CI build failed Details

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of sinon is breaking the build ๐Ÿšจ

The devDependency sinon was updated from 7.3.2 to 7.4.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of snyk is breaking the build ๐Ÿšจ

The dependency snyk was updated from 1.193.2 to 1.193.3.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

snyk is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v1.193.3

1.193.3 (2019-07-18)

Bug Fixes

  • add build-essential for Python (35eec56)
Commits

The new version differs by 2 commits.

  • 9bf3241 Merge pull request #664 from snyk/fix/add-build-essentials-python
  • 35eec56 fix: add build-essential for Python

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of codecov is breaking the build ๐Ÿšจ

The devDependency codecov was updated from 3.5.0 to 3.6.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

codecov is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 11 commits.

  • 2ed978c v3.6.0
  • 024cced Merge pull request #135 from iansu/codebuild
  • 24a0a76 Merge branch 'master' into codebuild
  • f628c33 Merge pull request #145 from fabiendem/semaphore-compat
  • 0c57093 Rename semaphore v2 clearly in tests
  • 5a5c489 Add retro-compatibility for Semaphore 1.x and maintain support for 2.x
  • a45a9b5 Revert "Updates Semaphore CI Service for 2.0 (#132)"
  • e2f6b81 Test improvements
  • 3faacd4 Add support for AWS CodeBuild
  • 8371836 Create CODE_OF_CONDUCT.md (#133)
  • 6167aa8 Updates Semaphore CI Service for 2.0 (#132)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of eslint-plugin-prettier is breaking the build ๐Ÿšจ

The devDependency eslint-plugin-prettier was updated from 3.1.0 to 3.1.1.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 17 commits.

  • cb2d4b3 Build: update package.json and changelog for v3.1.1
  • 8a793eb build(deps-dev): bump eslint from 6.3.0 to 6.4.0
  • 88c3f6c build(deps-dev): bump eslint-config-prettier from 6.2.0 to 6.3.0
  • 5f9fbc1 build(deps-dev): bump eslint-config-prettier from 6.0.0 to 6.2.0
  • 746b66d build(deps-dev): bump eslint from 6.2.2 to 6.3.0
  • 97eedb4 build(deps-dev): bump eslint from 6.1.0 to 6.2.2
  • afef9d1 build(deps-dev): bump eslint from 6.0.1 to 6.1.0
  • 0360a84 build(deps-dev): bump mocha from 6.1.4 to 6.2.0
  • 9eceb68 build(deps): [security] bump lodash from 4.17.11 to 4.17.14
  • 1385310 Fix: When forcing the JS parser, use the modern name (#212)
  • bca77e6 Add eslint 6 to test matrix (#210)
  • 4c069bd build(deps-dev): bump eslint-config-prettier from 5.0.0 to 6.0.0
  • 60bb22f build(deps-dev): bump eslint-config-prettier from 4.3.0 to 5.0.0
  • a183560 build(deps-dev): bump prettier from 1.18.0 to 1.18.2
  • 0cad479 build(deps-dev): bump prettier from 1.17.1 to 1.18.0

There are 17 commits in total.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of pg is breaking the build ๐Ÿšจ

The dependency pg was updated from 7.11.0 to 7.12.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

pg is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 9 commits.

  • e4578d2 Bump version
  • d44376a Update sponsors file
  • 94ad322 Update changelog
  • 3ead900 Fix eslint and add back standard (#1928)
  • 0894a3c feat: Add dynamic retrieval for client password (#1926)
  • 0acaf9d Fix compare (#1923)
  • d8a0e1e Update CI to allow tests to pass on Node.js >= 10.16.0 (#1912)
  • 2c7be86 minor text improvement in defaults (#1893)
  • 8ba1d2c Enable eslint:recommended and plugin/node/recommended (#1856)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of eslint-plugin-import is breaking the build ๐Ÿšจ

The devDependency eslint-plugin-import was updated from 2.18.0 to 2.18.1.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-plugin-import is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 14 commits.

  • b51aa2f Bump to v2.18.1
  • 32704da fix: Improve parse perf when using @typescript-eslint/parser
  • 3b21de6 [Tests] extract common "get parser" logic into test helpers
  • f4e3f1b prefer-default-export: don't warn on TypeAlias & TSTypeAliasDeclaration
  • 1caa402 [Fix] no-unused-modules: Exclude package "main"/"bin"/"browser" entry points
  • 22d5440 [fix] export: false positive for typescript overloads
  • 5abd5ed [Tests] temporarily disable these failing tests in eslint < 4
  • 752dcd5 [Tests] add missing --no-save to time travel script
  • d3a3fa5 [Refactor] no-extraneous-dependencies: remove the last bit of lodash
  • 8a38fd4 [Refactor] no-extraneous-dependencies: use Array.isArray instead of lodash
  • c5078ad [Refactor] importType: remove use of cond
  • 118afd4 no-deprecated: don't run tests for typescript-eslint-parser against ESLint <4
  • 6512110 fix tests for node 4 + fixed lint issues
  • bb9ba24 no-deprecated TS tests (#1315)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

๐Ÿ˜Ž Not really an issue.

@mickhansen @janmeier @sushantdhiman -Have a look at this module.

It takes care os establishing DB connections (Sequelize instances) and make models available throughout the application. It also supports multiple DB connections in the same application.

Let me know what you think and if this is something you would accept as part of the general Sequelize repository.

An in-range update of eslint-config-prettier is breaking the build ๐Ÿšจ

The devDependency eslint-config-prettier was updated from 6.0.0 to 6.1.0.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

eslint-config-prettier is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Commits

The new version differs by 4 commits.

  • c944458 eslint-config-prettier v6.1.0
  • e0b6648 Add function-call-argument-newline
  • 3955d29 Update npm packages
  • 61ac63a Fix broken link in changelog

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of sequelize is breaking the build ๐Ÿšจ

The dependency sequelize was updated from 5.10.1 to 5.10.2.

๐Ÿšจ View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

sequelize is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • โŒ continuous-integration/travis-ci/push: The Travis CI build failed (Details).

Release Notes for v5.10.2

5.10.2 (2019-07-23)

Bug Fixes

  • describetable: support string length for char in mssql (#11212) (1cffab7)
Commits

The new version differs by 7 commits.

  • 1cffab7 fix(describetable): support string length for char in mssql (#11212)
  • dc6249a docs: update links to sequelize.org
  • 6a8e08e docs: update links
  • cbb29de docs(readme): update docs link
  • 715a82f docs(dialect): remove broken link (#11193)
  • 0bc6d63 docs(migrations): explain config relation with node_env (#11194)
  • aede2b4 docs(migrations): seeder example (#11195)

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

An in-range update of sinon is breaking the build ๐Ÿšจ

Version 5.0.9 of sinon was just published.

Branch Build failing ๐Ÿšจ
Dependency sinon
Current Version 5.0.8
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

sinon is a devDependency of this project. It might not break your production code or affect downstream projects, but probably breaks your build or test tools, which may prevent deploying or publishing.

Status Details
  • โŒ continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details

Commits

The new version differs by 5 commits.

  • 86b930c Update docs/changelog.md and set new release id in docs/_config.yml
  • 033aa60 Add release documentation for v5.0.9
  • 3321085 5.0.9
  • 9f321d5 Update History.md and AUTHORS for new release
  • e862196 Upgrade @std/esm to esm.

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those donโ€™t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot ๐ŸŒด

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.