https://github.com/remrkabledev/postgres-pgnode_module
A short introduction to using the pg module on nodejs
https://github.com/remrkabledev/postgres-pgnode_module
Last synced: 9 days ago
JSON representation
A short introduction to using the pg module on nodejs
- Host: GitHub
- URL: https://github.com/remrkabledev/postgres-pgnode_module
- Owner: reMRKableDev
- Created: 2019-01-10T15:19:00.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T22:18:17.000Z (almost 3 years ago)
- Last Synced: 2025-11-23T13:16:15.204Z (7 months ago)
- Language: JavaScript
- Size: 156 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# postgres-pgnode_module
A short introduction to using the pg module on nodejs.
## Getting Started
Sample database operations ran from a node application.
Remember to change the Pool information in the 'config.js' file to match your system's db variables:
```
const pool = new Pool({
database: YOUR DATABASE,
host: YOUR HOST,
user: YOUR USER,
// also password if you have it setup.
});
```
### Prerequisites
What things you need to install the software and how to install them
```
node
postgresql
pg module
```
### 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.
OBS: At the top of some files you will see /_ eslint-disable no-console _/ line. Ignore this as I have been using eslint tool and needed to pass this so that the console methods didn't throw an error.
Have fun :)