Skip to content
This repository was archived by the owner on Apr 21, 2025. It is now read-only.

feathers-studio/pg-extract

Repository files navigation

Warning

The relevant parts of this repo were rolled into https://github.com/feathers-studio/true-pg, which was the primary purpose of this project.

This project is no longer maintained.

Extract Schema from Postgres Database

Reads various metadata from your postgres database and return a Javascript object. This package was originally forked from extract-pg-schema by Kristian Dupont to extend its utility and to generate perfect types. It's now a standalone package.

Note: This package is a work in progress and may have missing features or broken modules. However, it's already being used to generate types by TruePG. You should probably use that instead.

Installation

Choose your package manager:

bun add pg-extract
npm i pg-extract
pnpm add pg-extract

Library Usage

You give it a postgres connection config object and some options and it will connect to your database and generate an object with the schema.

import { Extractor } from "pg-extract";

const extractor = new Extractor({
	host: "localhost",
	database: "postgres",
	user: "postgres",
	password: "postgres",
});

const result = await extractor.extractSchemas();

console.log(result);

Contributors

We're grateful to Kristian Dupont and the other contributors to the extract-pg-schema project for the package we are building on top of.

About

Extract schema from Postgres. A more complete fork of https://github.com/kristiandupont/extract-pg-schema.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors 21