Per-resource column data for the planner and request-column validation.
info/2 combines the resource's config with the catalog types, keyed by Ecto field
name (the catalog itself is keyed by database column). The result is memoized next to
the catalog cache, so a request recomputes nothing. Request column names are database
names; translate_field/3 maps them to field names, which is how scoped sources
expose their columns, and fails with PostgREST's 42703 (with Postgres's closest-column
hint) or 42501 for a column outside readable:.
Summary
Functions
The exposed (Ecto field) name of a database column of module, without the catalog.
The info map of module: columns are {source, field_name} in field order,
by_source maps a database column to its field name, types and categories are keyed
by field name. schema is the resource's effective schema
(PgRest.SQL.ScopedSource.effective_schema/2). Calls the catalog (cached per schema) on
first use; not inside a transaction.
Whether the Ecto field is readable.
Request column (database name) to Ecto field name, or 42703 / 42501 (401 or 403 by the
info's :role, which PgRest.Planner sets).
Types
Functions
The exposed (Ecto field) name of a database column of module, without the catalog.
The info map of module: columns are {source, field_name} in field order,
by_source maps a database column to its field name, types and categories are keyed
by field name. schema is the resource's effective schema
(PgRest.SQL.ScopedSource.effective_schema/2). Calls the catalog (cached per schema) on
first use; not inside a transaction.
Whether the Ecto field is readable.
@spec translate_field(PgRest.AST.Field.t(), info(), String.t()) :: {:ok, PgRest.AST.Field.t()} | {:error, PgRest.Error.t()}
Request column (database name) to Ecto field name, or 42703 / 42501 (401 or 403 by the
info's :role, which PgRest.Planner sets).