Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/molizanee/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.
https://github.com/molizanee/postgresql-schema-extractor

javascript nodejs postgresql query schema

Last synced: 6 days ago
JSON representation

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.

Awesome Lists containing this project

README

        

# 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:
```env
PG_USER=your_username
PG_HOST=your_host
PG_DATABASE=your_database
PG_PASSWORD=your_password
PG_PORT=5432
```

## Usage
```bash
npm install
node index.js
```

The schema will be generated in `./schema/database--schema.json`