PostgreSQL CREATE TABLE example
A compact PostgreSQL table converted into SQLAlchemy 2.0 mapped columns.
CREATE TABLE users ( id integer PRIMARY KEY, email varchar(255) NOT NULL UNIQUE, created_at timestamp NOT NULL );
Code generation tool
Paste PostgreSQL CREATE TABLE statements and generate SQLAlchemy 2.0 DeclarativeBase model code with Mapped typing, mapped_column, primary keys, unique constraints, ForeignKey references, nullable flags, and visible warnings for unsupported SQL.
This tool runs locally in your browser. Your input is not uploaded.
Primary key, varchar length, unique email, boolean default, and timestamp.
Convert PostgreSQL CREATE TABLE DDL to generate SQLAlchemy 2.0 model code.
A compact PostgreSQL table converted into SQLAlchemy 2.0 mapped columns.
CREATE TABLE users ( id integer PRIMARY KEY, email varchar(255) NOT NULL UNIQUE, created_at timestamp NOT NULL );
Shows UUID, ForeignKey, and Numeric precision mapping.
CREATE TABLE orders ( id uuid PRIMARY KEY, user_id integer REFERENCES users(id), total numeric(10, 2) NOT NULL );
No. It only parses CREATE TABLE text locally in your browser and never uses eval or a database connection.
No. The MVP focuses on common CREATE TABLE columns, primary keys, unique constraints, foreign keys, defaults, and common PostgreSQL types.
Yes, it attempts to parse multiple CREATE TABLE statements and shows a warning that multiple tables were converted.