Open bhenderson opened 3 years ago
Good idea! Generating JSDoc comments from the actual database schema would be nice. At least for database tables. It can be done by integrating the following SQL query into the lib:
SELECT description FROM pg_description
JOIN pg_class ON pg_description.objoid = pg_class.oid
JOIN pg_namespace ON pg_class.relnamespace = pg_namespace.oid
WHERE relname = '<table name>' AND nspname='<schema name>'
We recently started putting comments into our database and we thought it would be awesome if this lib could add the comments as documentation in the output. This might be specific to postgres so I'm not sure how that would work. Potentially this lib could just offer a hook so we could add our own documentation before the typescript definition.
We add comments like this:
actually, the more I think about it, general hooks is probably the way to go. This would also solve my problems for #5 and #4.
great library by the way, it has been super helpful!