pg-typegen

JSON →
library 3.9.1 ·javascript
verified Jun 5, 2026

Generate TypeScript type definitions from a Postgres database schema. v3.9.1 — actively maintained, weekly releases. Connects directly to a Postgres instance via connection string and introspects tables, columns, enums, views, and materialized views. Supports configurable suffixes, custom schemas, insert types, comments, and multiple output styles (interfaces/types, semicolons, optionals). Key differentiator: maps Postgres types to native JavaScript/TypeScript types matching the pg driver output, with bigint, date, and enum handling. No ORM dependency.