Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 668 Bytes

README.md

File metadata and controls

34 lines (22 loc) · 668 Bytes

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:

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'"))
)
CREATE TABLE IF NOT EXISTS users (
	id SERIAL PRIMARY KEY NOT NULL,
	username VARCHAR (10) NOT NULL,
	description TEXT default 'It''s your description'
);