https://github.com/remrkabledev/sequelize-associations
An introduction to creating associations with Sequelize on Node.js
https://github.com/remrkabledev/sequelize-associations
database nodejs sequelize
Last synced: 4 months ago
JSON representation
An introduction to creating associations with Sequelize on Node.js
- Host: GitHub
- URL: https://github.com/remrkabledev/sequelize-associations
- Owner: reMRKableDev
- Created: 2019-05-27T16:28:00.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-10T14:45:07.000Z (over 1 year ago)
- Last Synced: 2025-04-02T12:38:57.955Z (about 1 year ago)
- Topics: database, nodejs, sequelize
- Language: JavaScript
- Homepage:
- Size: 167 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sequelize-associations
An introduction to creating associations with Sequelize on Node.js
## Getting Started
Change the .env.default file to a .env file which will hold the environment variables associated with your database.
Configure your Sequelize connector to read from process.env
```
const connector = new Sequelize(
process.env.YOUR_DATABASE_NAME,
process.env.YOUR_DATABASE_USER,
process.env.YOUR_DATABASE_PASSWORD,
{
host: process.env.YOUR_DATABASE_HOST,
dialect: YOUR_DATABASE_DIALECT
}
);
```
### Prerequisites
What things you need to install the software and how to install them
```
sequelize
pg
pg-hstore
dotenv
ejs
express
```
### How To:
To use the examples provided:
```
1. Clone repo.
2. Run 'npm install' on your local repo so as to get the required dependencies.
3. Choose desired folder + run node apps.
```
Remember that you can only run the "node app.js" when you are in a folder with an app.js.
Have fun :)