Bier.Plan (bier v0.1.0)

Copy Markdown View Source

Serves the application/vnd.pgrst.plan media type by running EXPLAIN over the request's read query and returning the planner output (JSON or text).

The response Content-Type echoes the plan format, the for= target media type, and any options= exactly as PostgREST does (see Bier.MediaType).

Summary

Functions

Run the EXPLAIN for a relation read query and render the plan response.

Wrap an already-built statement in the EXPLAIN the plan media type asks for.

Render the rows an EXPLAIN returned as the plan response.

Functions

explain(conn, pool, relation, plan, media)

Run the EXPLAIN for a relation read query and render the plan response.

explain_sql(media, sql)

Wrap an already-built statement in the EXPLAIN the plan media type asks for.

Upstream applies this to the whole statement — mtSnippet runs explainF over mainCall's snippet exactly as it does over mainRead's (Query/Statements.hs), which is why the RPC path can reuse it verbatim.

render(conn, media, rows)

Render the rows an EXPLAIN returned as the plan response.