pg-to-ts
Version:
Generate TypeScript-friendly interfaces and constants from (postgres) SQL database schema
12 lines (11 loc) • 765 B
TypeScript
/**
* Generate TypeScript interface definitions from your Postgres schema
* pg-to-ts is derived from PYST/schemats, which was a fork of SweetIQ/schemats.
*/
import { TableNames } from './typescript';
import Options, { OptionValues } from './options';
import { PostgresDatabase } from './schemaPostgres';
export declare function typescriptOfTable(db: PostgresDatabase, table: string, schema: string, options?: Options): Promise<[code: string, names: TableNames, typesToImport: Set<string>]>;
export declare function typescriptOfSchema(dbIn: PostgresDatabase | string, tables?: string[], excludedTables?: string[], inSchema?: string | null, options?: OptionValues): Promise<string>;
export { Database } from './schemaInterfaces';
export { Options, OptionValues };