https://github.com/danieldacosta/database-connection
Script for connecting and executing queries into Postgres database
https://github.com/danieldacosta/database-connection
postgres psycopg2 sql
Last synced: about 2 months ago
JSON representation
Script for connecting and executing queries into Postgres database
- Host: GitHub
- URL: https://github.com/danieldacosta/database-connection
- Owner: DanielDaCosta
- Created: 2021-09-27T14:17:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-28T19:42:08.000Z (over 4 years ago)
- Last Synced: 2025-10-19T07:48:03.216Z (8 months ago)
- Topics: postgres, psycopg2, sql
- Language: Python
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Database Connection
Python script for connecting and executing queries into a **Postgres** database.
# Prerequisites
Set-up your Database credentials into **Parameter Store/AWS System Manager**.
Install `psycopg2`: `pip install psycopg2-binary`.

# Usage
1. Set the variable PATH_DB_NAME on file `config.py`.
2. Right your queries in the folder `Queries`
3. Run your Postgres commands. Check all the available functions on the file `database.py`
4. Check `example.py` for how to use the module.
# References & Acknowledgments
`psycopg2` library:
- https://www.psycopg.org/docs/usage.html