1.0.23 • Published 3 years ago

models-sequelize v1.0.23

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

models-sequelize

Sequelize configuration library

Usage

To connect to the database it is necessary to pass a database url along with two other parameters, options and path, which are respectively the options for connecting to sequelize and the path where the models are located src/app/models, src/models, models... See the example:

When connection is established you see this message:

[postgres] Connection established successfully.

const { Connection, db } = require("models-sequelize");

// databaseUrl is url of database
// options is options of sequelize connection
// path of models
new Connection().db(databaseUrl, options, path);

console.log(db); // db instance

const users = await db.User.findAll();

console.log(users); // all users of database
1.0.23

3 years ago

1.0.22

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.17

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago