Support structured data in PostgreSQL COMMENT
s
#3487
Labels
idea
Needs of discussion to become an enhancement, not ready for implementation
COMMENT
s
#3487
Problem
PostgREST allows to specify additional metadata to document the offered RESTful API via PostgreSQL
COMMENT
s. Other tools also leverage PostgreSQLCOMMENT
s to specify additional metadata or configuration, e.g.@graphql(<JSON>)
"comment directives"@tag object
"smart tags"@type {type}
annotations which conform to JSDoc tagsIf one decides to use one of these tools in conjunction with PostgREST, conflicts arise, i.e. PostgREST won't ignore the above tags but include them in the generated OpenAPI description. The underlying problem could be summarized as the lack of a common standard to include structured data in PostgreSQL
COMMENT
s1.Solution
In another discussion @wolfgangwalther suggested to
YAML headers seem powerful (e.g. multiple tools could read the same keys) and pragmatic at the same time (not too hard to parse and can be implemented in a backwards-compatible way), so other tools would hopefully add support for it, too. The author of pg_graphql already showed approval and would implement it. YAML headers would also allow to "hide" arbitrary data from PostgREST like the above @-tags by simply defining them inside the YAML header (under a key that has no meaning for PostgREST). In the end, the possible use cases go far beyond PostgREST – but PostgREST could lead the way!
Previous discussion
Further notes
COMMENT
keyword is not part of the SQL standard, but various other DBMS' offer the same (e.g. Oracle Database) or very similar (e.g MariaDB/MySQL) functionality. SQLite unfortunately has no such notion.Footnotes
A web search did not reveal any kind of existing initiative to establish such a standard. Please correct me, if I missed something! ↩
The text was updated successfully, but these errors were encountered: