- New option:
--prefixWithSchemaNames
. This adds the schema as a prefix to all output symbols and types. Useful for when you have many schemas in your database and need to keep all the tables straight. See #14, thanks @jamesone! - New feature: type links in runtime values. The runtime constants generated
for each table now contain
$type
and$input
properties, and foreign keys have a$type
property to connect to the linked type. This means thattypeof tableName['$type']
can be used to get the (TypeScript) table type. This should be especially helpful for libraries using pg-to-ts.
- Dependency updates; pg-to-ts should now work with Node 14+.
- Officially dropped support for Node 6.
- Remove
export namespace every
variants ofenum
types (it's unclear to me how these were ever intended to work). - Added types for enum arrays (previously they were typed to
any
, now they're typed toEnumType[]
). - Changed the prefix for environment variables from
SCHEMATS
→PG_TO_TS
and documented how to use them. - Changed the default config file name from
schemats.json
topg-to-ts.json
. - Significantly modernize tooling; unit tests now run via GitHub actions and post code coverage.
- Make TypeScript a peer dependency, rather than a direct dependency.
- Added
--jsonTypesFile
option. - Rewrote
README.md
and renamed the repo topg-to-ts
to match the name on npm.