3 ms·
> The OP didn't write about a UI and we don't know what their needs are, [...] > What I claim is that doing the work directly in the database shouldn't be rul
by cryptonector 3y ago
> The OP didn't write about a UI and we don't know what their needs are, [...]
> What I claim is that doing the work directly in the database shouldn't be ruled out in general (the specifics of a given use-case may rule it out in particular) any more than the other common patterns (API hand-written in Python, for instance) shouldn't be ruled out in general.
Hear hear.
With PG's COMMENT feature one can enrich SQL schema with the sorts of metadata one needs for UI generation.
Here's a script that generates a JSON view of a PG SQL schema enriched with JSON from COMMENTs: https://github.com/twosigma/postgresql-contrib/blob/master/schema2json.sh https://github.com/twosigma/postgresql-contrib/blob/master/s... and https://github.com/twosigma/postgresql-contrib/blob/master/schema2json.sql https://github.com/twosigma/postgresql-contrib/blob/master/s...