JSPM

pg-ts-interface-generator

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15196F
  • License MIT

Generate TypeScript interfaces from PostgreSQL database

Package Exports

  • pg-ts-interface-generator
  • pg-ts-interface-generator/build/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (pg-ts-interface-generator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

pg-ts-interface-generator

npm

pg-ts-interface-generator is a command-line tool built with Node.js that can generate TypeScript interfaces from a PostgreSQL database.

Note: This tool is intended to be a simple solution, there are better alternatives available for generating TypeScript interfaces from PostgreSQL databases. Consider using other more mature and feature-rich libraries if your requirements are more complex.

Installation

To install pg-ts-interface-generator, use npm:

npm install -g pg-ts-interface-generator

Usage

pg-ts-interface-generator -c postgres://user:password@host:5432/dbname -o schema.ts

Output example:

interface data_types_table {
  column_uuid: string;
  column_date: Date;
  column_boolean: boolean;
}

interface users {
  user_id: string;
  email_string: string;
  is_verified: boolean;
}

You can also specify host, user, port and dbname instead of specifying a connection string:

pg-ts-interface-generator -h localhost -U user -p 5432 -d dbname -o schema.ts

License

This project is licensed under the MIT License.