postgrest-docs icon indicating copy to clipboard operation
postgrest-docs copied to clipboard

Include generated query in the API

Open steve-chavez opened this issue 3 years ago • 3 comments

Besides the generated query, we can also include the recommended indexes.

steve-chavez avatar Apr 25 '22 18:04 steve-chavez

I think the way to do this would be:

  • Create unit tests for the PostgREST.Query.Statements module in core.
  • Copy/Paste the result of the tests on the docs - which are the generated queries
  • If the queries do change in core, the resulting unit tests would fail - so that would let us know when to update the docs as well.

steve-chavez avatar May 06 '22 18:05 steve-chavez

What I like about this:

  • Increasing overall code quality - more unit tests
  • If maintenance turns out to be high, it would force us to merge docs with core

steve-chavez avatar May 06 '22 18:05 steve-chavez

If we do the application/sql feature(mentioned in https://github.com/PostgREST/postgrest/issues/2354#issue-1287975919), unit tests would not be needed. We'd just include the application/sql output next to the request in the docs.

steve-chavez avatar Jun 29 '22 17:06 steve-chavez