Bier.Plugs.ActionController (bier v0.1.0)

Copy Markdown View Source

Request-time controller for the read + mutation pipeline.

Every request reaches this plug via the catch-all router. It:

  1. resolves the target {schema, relation} from the path + Accept-Profile / Content-Profile (default schema = first of db_schemas),
  2. negotiates the response media type against the Accept header,
  3. parses the query string with Bier.QueryParser,
  4. builds and runs one parameterized JSON query via Bier.QueryExecutor,
  5. renders the negotiated format (JSON / CSV / singular object / nulls-stripped / EXPLAIN plan) with a Content-Range.

Anything that is not a successful Plug.Conn falls through to Bier.Plugs.FallbackController, which emits the PostgREST error envelope.