https://github.com/bybenpuls/table-builder-pg
Simple tables creator
https://github.com/bybenpuls/table-builder-pg
asyncpg pg postgresql psycopg2 python python-sql sql
Last synced: about 1 month ago
JSON representation
Simple tables creator
- Host: GitHub
- URL: https://github.com/bybenpuls/table-builder-pg
- Owner: byBenPuls
- License: mit
- Created: 2024-07-12T10:51:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-16T22:57:03.000Z (over 1 year ago)
- Last Synced: 2025-06-09T11:58:10.282Z (9 months ago)
- Topics: asyncpg, pg, postgresql, psycopg2, python, python-sql, sql
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postgresql Table Builder
### 🌐 Installation and updating
`py -m pip install --upgrade pg_table_builder`
### ⚙️ Features
You can get SQL query string for creating table
Example:
```python
from pg_table_builder import Table, Column, Serial, Varchar, Text
Table(
"users",
Column("id", Serial(primary_key=True, not_null=True)),
Column("username", Varchar(limit_size=10, not_null=True)),
Column("description", Text(default_expression="'It''s your description'"))
)
```
```sql
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY NOT NULL,
username VARCHAR (10) NOT NULL,
description TEXT default 'It''s your description'
);
```