Skip to content

A lightweight tool to automatically extract and document your PostgreSQL database schema. This tool generates a comprehensive JSON file containing detailed information about tables, columns, data types, constraints, and primary keys.

Notifications You must be signed in to change notification settings

Molizanee/postgresql-schema-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostgreSQL Schema Extractor

A lightweight tool to automatically extract and document your PostgreSQL database schema. This tool generates a comprehensive JSON file containing detailed information about tables, columns, data types, constraints, and primary keys.

Features

  • Extracts complete database schema including table structures
  • Documents column properties (types, nullability, defaults)
  • Identifies primary key constraints
  • Saves schema in a well-structured JSON format
  • Environment variable support for secure database connections

Configuration

Before running, set up your database connection details in a .env file:

PG_USER=your_username
PG_HOST=your_host
PG_DATABASE=your_database
PG_PASSWORD=your_password
PG_PORT=5432

Usage

npm install
node index.js

The schema will be generated in ./schema/database-<YOUR_DB_NAME>-schema.json

About

A lightweight tool to automatically extract and document your PostgreSQL database schema. This tool generates a comprehensive JSON file containing detailed information about tables, columns, data types, constraints, and primary keys.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published