@zanma-lms-ksquare/savvy-psql-connector
v2.0.0
Published
Package includes connection and models for Zavvy database
Readme
Savvy PSQL Connector
Package includes connection and models for Zavvy database
Requirements
Create your .env file using following format (or add them to the existing .env file):
DB_NAME=savvyDb
DB_USER=savvyDbUser
DB_PASSWORD=savvyDbpassword
DB_HOST=savvyDbHost
DB_PORT=5432How to install
1.- Download the repository
2.- Install npm i
How to use:
const dbConnection = require('savvy-psql-connector');
const DbModel = await dbConnection();
const { User } = DbModel;
const users = await User.findAll();
console.log(users); // Returns array of usersList of models available:
| Model Name | Description | |---------------|-----------------------------| | User | Table Users |
Unit tests
npm test