A single exposed relation (table or view) with its structure.
Summary
Types
Maps each computed field name to the schema its function lives in.
Data-representation cast functions for a DOMAIN-typed column (PostgREST
"Data representations"). Each is a {schema, function} tuple or nil
HTTP methods the OpenAPI document advertises for this relation. nil
(the introspection default) means "derive from kind": tables get the
full set, views GET only. openapi-mode = follow-privileges overrides
it with the methods the request role is actually granted.
Types
Maps each computed field name to the schema its function lives in.
That schema is not necessarily the relation's own: PostgREST only requires a
computed field's function to sit in an exposed schema or on the extra search
path, so test.foo(other.bar) is legal. Every call site qualifies the call
with this schema rather than schema (see #100).
@type data_rep() :: %{ read: {String.t(), String.t()} | nil, write: {String.t(), String.t()} | nil, text: {String.t(), String.t()} | nil }
Data-representation cast functions for a DOMAIN-typed column (PostgREST
"Data representations"). Each is a {schema, function} tuple or nil:
read—CREATE CAST (<domain> AS json): domain value -> JSON output.write—CREATE CAST (json AS <domain>): JSON body value -> domain.text—CREATE CAST (text AS <domain>): query-string filter value -> domain (used to parsecol=eq.<raw>predicates).
@type methods() :: [:get | :post | :patch | :delete] | nil
HTTP methods the OpenAPI document advertises for this relation. nil
(the introspection default) means "derive from kind": tables get the
full set, views GET only. openapi-mode = follow-privileges overrides
it with the methods the request role is actually granted.
@type t() :: %Bier.Introspection.Relation{ columns: [column()], comment: String.t() | nil, computed_column_schemas: computed_schemas(), computed_column_types: %{optional(String.t()) => String.t()}, computed_columns: [String.t()], computed_relations: [map()], foreign_keys: [foreign_key()], kind: :table | :view, methods: methods(), name: String.t(), primary_key: [String.t()], schema: String.t() }