https://github.com/sercheo87/template-dynamically-report-ppl-postgres
This project is used to generate a report of a client by custom configuration inside **Postgres SQL** using [Python Procedural Language](https://www.postgresql.org/docs/14/plpython.html).
https://github.com/sercheo87/template-dynamically-report-ppl-postgres
postgres postgresql ppl python python3
Last synced: 2 months ago
JSON representation
This project is used to generate a report of a client by custom configuration inside **Postgres SQL** using [Python Procedural Language](https://www.postgresql.org/docs/14/plpython.html).
- Host: GitHub
- URL: https://github.com/sercheo87/template-dynamically-report-ppl-postgres
- Owner: sercheo87
- Created: 2023-03-14T13:33:34.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-03-14T14:34:51.000Z (about 2 years ago)
- Last Synced: 2025-01-29T05:28:51.771Z (4 months ago)
- Topics: postgres, postgresql, ppl, python, python3
- Language: PLpgSQL
- Homepage:
- Size: 54.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# template-dynamically-report-ppl-postgres
## Description
This project is used to generate a report of a client by custom configuration inside **Postgres SQL** using [Python Procedural Language](https://www.postgresql.org/docs/14/plpython.html).
## Characteristics
- The report is generated dynamically by the configuration of the client.
- The configuration is stored in file ***Json*** in server database.
- The configuration client is stored in file ***Json*** in server database.
- All utility used are **functions** in **Postgres SQL** with **Python 3 Language**.## Requirements
- Instance of **Postgres SQL v14**.
- Install **Python 3** in server.## Installation
### Automatic Installation
```bash
make up-server
make build-functions
```### Manual
Up the instance of **Postgres SQL v14**.
```bash
cd ./pg-python-instance
docker-compose up -d
```Connect to server with:
- Host: **localhost**
- Port: **5432**
- User: **postgres**
- Password: **my123password**Install **Python 3 Extension** in server.
```bash
docker-compose exec postgres psql -U postgres -d my123password -c "CREATE EXTENSION IF NOT EXISTS plpython3u;"
```Create function base of templates configuration.
```bash
docker-compose exec postgres psql -U postgres -d my123password -f /pg-scripts/function-template-by-client.sql
```Create function base of client configuration.
```bash
docker-compose exec postgres psql -U postgres -d my123password -f /pg-scripts/function-read-client.sql
```Create function for get configuration by client.
```bash
docker-compose exec postgres psql -U postgres -d my123password -f /pg-scripts/function-template-by-client.sql
```Create function for generate report.
```bash
docker-compose exec postgres psql -U postgres -d my123password -f /pg-scripts/function_generate_report.sql
```