https://github.com/3n3a/pg-html
HTML from your Postgres Database
https://github.com/3n3a/pg-html
database html pgsql postgresql python3
Last synced: 4 months ago
JSON representation
HTML from your Postgres Database
- Host: GitHub
- URL: https://github.com/3n3a/pg-html
- Owner: 3n3a
- Created: 2023-03-03T21:30:58.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T18:59:42.000Z (over 3 years ago)
- Last Synced: 2025-01-08T22:09:47.580Z (over 1 year ago)
- Topics: database, html, pgsql, postgresql, python3
- Language: PLpgSQL
- Homepage:
- Size: 131 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pg-html
HTML from your Database
>
> **Disclaimer**: all the content in this repository is for research purposes only. I wouldn't recommend running this in production, well not yet.
>
The Idea being, that you can generate HTML from within the SQL, as like a function. Because wouldn't it be cool, if I could say like "render me this table as a literal html table", right?
## usage
because i needed python in the postgresql enabled. I forked the standard docker-postrgres image and commented out the line that removes these features.
you can build the image for yourself like so:
```bash
git clone https://github.com/3n3a/postgres-plpython3u
cd postgres-plpython3u
docker build -t postgres:14-alpine-py3 ./14/alpine/
```
for version 14 you could also pull it from here:
```bash
docker pull 3n3a/postgres:14-alpine-py3
```
### running the db
the image wasn't modified apart from the addition of the plpython3u library.
so it supports all the attributes and variables that the standard `postgres` one does too.
## exampl
The [countries.html](./docs/countries.html) is an example output of `table_to_html` function.
[View Live Version](https://gh.3n3a.ch/pg-html/countries.html)