tjwebb / pg-json-schema-export

Export Postgres schemas as JSON ( tables, constraints, sequences)
https://www.npmjs.org/package/pg-json-schema-export
MIT License
38 stars 18 forks source link

Fixed quoting issue for tables not using all lowercase names, fixed authentication problems, updated lodash usage, updated a few dependencies #10

Closed ptumati closed 5 years ago

ptumati commented 6 years ago

This utility was very useful -- thanks! Regarding the pull request: When I used the package, my use case had tables with names that weren't all lower case. Your SQL files needed to append quotes to the query. (I haven't tested what happens with lowercase names but I suspect it still works.) Adding the quotes fixed my problems.

Regarding the dependencies, the knex version on the original distribution was having authentication problems with pg. Updating a few dependencies seemed to resolve the issues. indexBy became keyBy. My testing wasn't thorough and I was trying to hack together a fix, but hopefully this pull request could help others who come across this package. Thanks again.

Edit: Added a callback to close the connections made by knex so binaries using this utility can exit properly.