pdbr

package module
v0.19.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2026 License: MIT Imports: 33 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

pdbr

CI Release Go Reference

Zero-boilerplate REST API for PostgreSQL, in the spirit of PostgREST: point it at a live database and it introspects pg_catalog, generates a REST surface (resources, embeds, filters, keyset pagination, CRUD, RPC, OpenAPI 3.1), and compiles every HTTP request into one parameterized SQL statement that returns the response JSON directly — no N+1, no per-row marshaling in Go. It is the sibling of pdbq (same engine, GraphQL); the shared half lives in pdbcore.

$ pdbr serve --database.url postgres://localhost/mydb --auth.mode none --roles.switch=false
time=... msg=introspected tables=12 enums=3 functions=2 took=38ms
time=... msg=listening addr=:8080 base_path="" openapi=true
$ curl 'localhost:8080/users?select=id,email,posts(title)&mood=eq.happy&limit=2'

Highlights

  • Single-statement compilation — embeds become LEFT JOIN LATERAL, lists become json_agg, rows become json_build_object; PostgreSQL returns the response JSON directly. Mutations are WITH __mut AS (DML RETURNING …) SELECT …, nested mutations one multi-CTE statement.
  • PostgREST-style URL grammar — select= with embeds and aliases, col=op.value filters with and=/or=/not. logic, order=, limit/offset, keyset after=/before= cursors, count=true, distinct=, /by/{cols}/{vals} unique lookups, /rpc/{fn}.
  • RLS-aware by default — each request runs with SET LOCAL ROLE and claims exposed via set_config('jwt.claims.*', ...) (and optionally as one JSON object such as PostgREST's request.jwt.claims) from a verified JWT or trusted gateway headers; requests without credentials are refused unless an anonymous role is configured. The claim settings are shared with pdbq and PostGraphile so existing policies work unchanged.
  • Filters with an indexed-only policy — only indexed columns are filterable/orderable out of the box (filters.indexed_only: false opens it up), with per-type operator sets and @filterable smart-comment opt-in.
  • HTTP done properly — RFC 9457 problem+json errors with stable codes, weak ETags computed in SQL with If-None-Match/If-Match, Prefer: return=minimal, text/csv streaming, Link/X-Next-Cursor headers, 405 + Allow for what a resource does not support.
  • OpenAPI 3.1 — GET /openapi.json is a pure function of the database (+ config + plugins), deterministic and pinned by golden tests. No embedded UI, no CDN assets: bring your own tooling.
  • Schema cache — pdbr schema dump / serve --schema.cache_path boots without touching pg_catalog; pdbr schema check is a CI drift gate; cache files are interchangeable with pdbq.
  • Watch mode — a DDL event trigger (or poll fallback) re-introspects and atomically swaps the API during development.
  • Plugins — five small hook interfaces (catalog, inflection, API, compile, request) with four built-ins: smart_comments, advanced_filters, postgis, nested_mutations.
  • Schema contracts — per-audience APIs (public, partner, internal) selected by @contract / @behavior ±contract:<name> smart comments, each under its own base path with its own OpenAPI document, see docs/contracts.md.
  • Pipe-friendly CLI — pdbr request GET '/users?select=id' | jq prints the body, exits non-zero on 4xx/5xx, and --print-sql shows the exact statement without a database.
  • Library embedding (experimental) — pdbr.New(cfg, pdbr.WithPlugins(...)).Handler(ctx) mounts the whole API (watch mode included) in your own net/http mux. The Go API is outside the 1.0 compatibility promise.

Installation

Prebuilt binaries for Linux, macOS and Windows (amd64/arm64) are attached to each release with a checksums.txt (signed with cosign), a CycloneDX SBOM and build provenance attestations, see SECURITY.md:

$ VERSION=$(curl -fsSL https://api.github.com/repos/suprbdev/pdbr/releases/latest | sed -n 's/.*"tag_name": *"v\([^"]*\)".*/\1/p')
$ curl -fsSL https://github.com/suprbdev/pdbr/releases/download/v$VERSION/pdbr_${VERSION}_linux_amd64.tar.gz | tar xz
$ ./pdbr --version

Or the (multi-arch, distroless) Docker image:

$ docker run --rm ghcr.io/suprbdev/pdbr:latest --version

Or build from source:

$ go install github.com/suprbdev/pdbr/cmd/pdbr@latest

Quickstart

$ make dev                   # PostGIS-enabled Postgres + fixture + pdbr in watch mode (no host ports: add compose.override.yaml)
$ curl localhost:8080/openapi.json | jq .paths | head

Or against your own database:

$ pdbr config init          # writes a starter pdbr.yaml: no auth, connection role
$ pdbr serve

The starter (and the first example above) run without authentication as the connection role; configure auth and roles before production (docs/rls.md). The defaults verify JWTs and refuse requests without credentials.

See docs/quickstart.md for the full tour, including Secure setup with roles, a JWT and a row-level security policy. Coming from PostgREST? See docs/migrating-from-postgrest.md.

Stability

pdbr follows semantic versioning. Configuration keys, the CLI, the HTTP surface and REST grammar, error codes and metrics are covered by the 1.0 compatibility promise; a few features (contracts, nested and partial mutations, rasters and others) and the Go embedding and plugin API are experimental and outside it. Details, the deprecation policy and the supported PostgreSQL versions (14 to 19) are in docs/compatibility.md. Report vulnerabilities as described in SECURITY.md. See CONTRIBUTING.md and CHANGELOG.md.

Documentation

Doc Contents
docs/features.md Feature support checklist (parity with pdbq, new-to-REST, tiers)
docs/quickstart.md First run, first requests
docs/api.md Routes, select= grammar, embeds, hints, headers
docs/filtering.md Filter operators, logic, relation/computed filters, indexed-only policy, ordering, distinct
docs/pagination.md limit/offset, keyset cursors, count=true, Link headers, cost limit
docs/aggregates.md select= aggregate functions (count(), sum, avg, max, min, spatial extent/union/collect/centroid), grouping, embeds, ordering
docs/mutations.md POST/PATCH/PUT/DELETE, bulk, upsert, If-Match, Prefer, nested mutations
docs/rpc.md Functions as endpoints, computed columns, JWT minting
docs/errors.md Problem Details format, code catalogue, status mapping
docs/openapi.md What the generated OpenAPI 3.1 document contains
docs/configuration.md Config layering; full reference in examples/pdbr.example.yaml
docs/upgrading.md Breaking changes and config migration between releases
docs/compatibility.md Versioning, what 1.0 freezes, experimental features, deprecation, supported versions
docs/migrating-from-postgrest.md Moving from PostgREST v12 or v13
docs/cli.md All subcommands, scripting patterns
docs/rls.md Roles, JWT/header claims, policies
docs/smart-comments.md @omit/@name/@foreignKey/… tags with REST semantics
docs/postgis.md GeoJSON, spatial filters, pseudo-columns, distance ordering
docs/contrib.md Full-text search, trigrams, unaccent, hstore, ltree, ranges, inet, citext, pgvector: operators, rank/similarity/vector-distance ordering, values
docs/plugins.md Hook surfaces, writing a plugin, built-ins as worked examples
docs/caching.md Schema cache and CI/CD gates
docs/deployment.md Docker image, health checks, production checklist
docs/contracts.md Schema contracts: per-audience APIs from @contract tags, base paths, security model
docs/metrics.md Prometheus /metrics: enabling, separate listener, metric and route-class reference, scrape config
docs/architecture.md Pipeline, plan.Request, compiler contract, invariants, gotchas
docs/pdbcore.md The shared pdbcore module (pdbq ↔ pdbr) and the dependency bump procedure

Development

$ make test          # unit + golden tests (no database needed)
$ make test-e2e      # end-to-end suite against a disposable PostGIS Postgres (-p pdbr-test, port 5433)
$ make bench         # API-build, compile and OpenAPI benchmarks
$ make fuzz          # fuzz the filter/spatial/URL-grammar → SQL paths (FUZZTIME=30s each)
$ make lint          # golangci-lint (config committed)
$ make example-config # regenerate examples/pdbr.example.yaml from struct tags
$ make fixture       # regenerate db/init/01-schema.sql from pdbcore's fixture
$ make dev           # live stack with watch mode
$ make docker-build  # distroless image
$ make help          # every target

Golden tests are the compiler's regression net: each .http request in internal/compile/testdata/ has its compiled SQL snapshotted next to it (regenerate with go test ./internal/compile/ -update). CLAUDE.md is the maintainer's map of the code (architecture, contracts, gotchas).

Load benchmarks (pdbr and PostgREST lanes next to pdbq) are tracked in pg-vs-pdbq, not here.

License

MIT, (c) 2026 suprb.

Documentation

Overview

Public embedding surface: aliases that let external modules construct a Config, implement plugin hooks, and mount pdbr inside their own HTTP mux. The implementation stays under internal/; aliases are the contract.

Package pdbr wires the subsystems into a runnable application and is the embedding surface for third-party plugins: import pdbr as a library and run pdbr.New(cfg, pdbr.WithPlugins(myPlugin)).Serve(ctx).

Index

Constants

View Source
const (
	KindResourcePath     = inflect.KindResourcePath
	KindFieldName        = inflect.KindFieldName
	KindRelationForward  = inflect.KindRelationForward
	KindRelationBackward = inflect.KindRelationBackward
	KindRPCName          = inflect.KindRPCName
	KindComputedField    = inflect.KindComputedField
	KindEnumValue        = inflect.KindEnumValue
)

Inflection kinds pdbr asks the naming chain for.

Variables

This section is empty.

Functions

func ExampleConfigYAML

func ExampleConfigYAML() string

ExampleConfigYAML renders the annotated reference configuration.

Types

type APIBuilder

type APIBuilder = api.Builder

Types referenced by hook signatures, the plan and the executor.

type APIHook

type APIHook = plugin.APIHook

Plugin hook surface.

type App

type App struct {
	Config   config.Config
	Registry *plugin.Registry
	Log      *slog.Logger
	Version  string
	// contains filtered or unexported fields
}

App is a configured pdbr instance.

func New

func New(cfg config.Config, opts ...Option) *App

New creates an App with the built-in plugins registered.

func (*App) BuildAPI

func (a *App) BuildAPI(ctx context.Context, cat *introspect.Catalog) (*api.Built, error)

BuildAPI runs the model pipeline: catalog hooks -> inflection -> default generation -> API hooks -> Build. Warnings are logged as they arise.

func (*App) BuildContractAPI added in v0.10.0

func (a *App) BuildContractAPI(ctx context.Context, cat *introspect.Catalog, name string) (*api.Built, error)

BuildContractAPI builds the API of the configured contract name, under its base path, from a filtered copy of cat, leaving cat unmodified so every contract can be built from one catalog; "" builds the full API exactly as BuildAPI does (modifying cat).

func (*App) Close

func (a *App) Close()

Close stops any running schema watcher, waits for it to release its connection, then closes the pool. It is idempotent, needs no prior Serve or Handler call, and does not require the context given to them to be cancelled first.

func (*App) CompileSQL

func (a *App) CompileSQL(ctx context.Context, r *http.Request) (string, error)

CompileSQL runs the boot pipeline without connecting to the database (schema.cache_path, or a live catalog when no cache is configured) and returns the compiled statement for r in the golden format without executing it (pdbr request --print-sql). Routing, parse and compile failures come back as *exec.Error.

func (*App) Connect

func (a *App) Connect(ctx context.Context) error

Connect opens the pool (idempotent).

func (*App) Handler

func (a *App) Handler(ctx context.Context) (http.Handler, error)

Handler runs the boot pipeline (catalog -> plugins -> api.Built -> runtime) and returns the http.Handler for embedding in a larger mux. Watch mode, when enabled, hot-swaps the runtime behind the returned handler exactly as Serve does. With contracts configured, the handler serves each contract's API under its base path instead (see docs/contracts.md).

func (*App) LoadCatalog

func (a *App) LoadCatalog(ctx context.Context) (*introspect.Catalog, error)

LoadCatalog loads the schema cache when configured, else connects and introspects.

func (*App) Metrics added in v0.6.0

func (a *App) Metrics() *metrics.Metrics

Metrics returns the Prometheus instruments the App records into: the instance given to WithMetrics, else the one created for metrics.enabled, else nil (every recording call on a nil *metrics.Metrics is a no-op).

func (*App) Plugins

func (a *App) Plugins() []plugin.Plugin

Plugins lists registered plugins in execution order (`pdbr plugins list`).

func (*App) Pool

func (a *App) Pool() *pgxpool.Pool

Pool exposes the connection pool (nil before Connect).

func (*App) ReadOnly

func (a *App) ReadOnly() bool

ReadOnly reports whether read-only mode is currently on.

func (*App) Runtime

func (a *App) Runtime(built *api.Built) (*server.Runtime, error)

Runtime assembles the server runtime for a built API: the compile chain (core compiler wrapped by CompileHooks), the executor over the pool, and the route handler. The pool may be nil (schema-cache boot without a database): requests then fail with 503, --print-sql still works.

func (*App) Serve

func (a *App) Serve(ctx context.Context) error

Serve runs the HTTP server (and watch mode when enabled) until ctx ends.

func (*App) SetReadOnly

func (a *App) SetReadOnly(v bool)

SetReadOnly toggles read-only mode at runtime: when on, every write is answered with 405 (code read_only) before it compiles or touches the database. Safe for concurrent use; persists across watch-mode swaps.

func (*App) WatchReady added in v0.9.0

func (a *App) WatchReady() <-chan struct{}

WatchReady returns a channel closed once the schema watcher started by the last Handler or Serve call is listening for DDL; changes committed after it closes are never missed. It is already closed when watch mode is off or no server has been built.

type AuthConfig

type AuthConfig = confx.Auth

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type Built

type Built = api.Built

Types referenced by hook signatures, the plan and the executor.

type Catalog

type Catalog = introspect.Catalog

Types referenced by hook signatures, the plan and the executor.

type CatalogHook

type CatalogHook = plugin.CatalogHook

Plugin hook surface.

type ClaimsConfig added in v0.18.0

type ClaimsConfig = confx.Claims

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type CompileFunc

type CompileFunc = compile.Func

Types referenced by hook signatures, the plan and the executor.

type CompileHook

type CompileHook = plugin.CompileHook

Plugin hook surface.

type CompileRequest

type CompileRequest = compile.Request

Types referenced by hook signatures, the plan and the executor.

type Computed

type Computed = api.Computed

Types referenced by hook signatures, the plan and the executor.

type Config

type Config = config.Config

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the documented defaults.

func LoadConfig

func LoadConfig(path string, flags *flag.FlagSet) (Config, error)

LoadConfig builds the effective config: defaults < YAML < PDBR_* env < flags (nil flags is fine) and validates it.

type ContractConfig added in v0.10.0

type ContractConfig = confx.Contract

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type DatabaseConfig

type DatabaseConfig = confx.Database

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type ErrorsConfig

type ErrorsConfig = confx.Errors

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type FiltersConfig

type FiltersConfig = confx.Filters

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type HeadersConfig added in v0.18.0

type HeadersConfig = confx.Headers

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type InflectInput

type InflectInput = coreinflect.Input

Types referenced by hook signatures, the plan and the executor.

type InflectKind

type InflectKind = coreinflect.Kind

Types referenced by hook signatures, the plan and the executor.

type InflectNext

type InflectNext = coreinflect.Next

Types referenced by hook signatures, the plan and the executor.

type InflectionHook

type InflectionHook = plugin.InflectionHook

Plugin hook surface.

type JWTConfig added in v0.18.0

type JWTConfig = confx.JWT

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type LogConfig

type LogConfig = confx.Log

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type Operation

type Operation = exec.Operation

Types referenced by hook signatures, the plan and the executor.

type Option

type Option func(*App)

Option customizes an App.

func WithLogger

func WithLogger(l *slog.Logger) Option

WithLogger overrides the default logger.

func WithMetrics added in v0.6.0

func WithMetrics(m *metrics.Metrics) Option

WithMetrics makes the App record into m instead of the instance it creates when metrics.enabled is set, so embedders can build one with their own Registerer and ConstLabels. The App registers its pool and its product counters on m, so m serves one App only. The endpoint at metrics.path is still served only when metrics.enabled is set; without it the embedder serves m.Handler() itself.

func WithPlugins

func WithPlugins(plugins ...plugin.Plugin) Option

WithPlugins registers additional plugins (the library embedding pattern).

func WithVersion

func WithVersion(v string) Option

WithVersion sets the version reported in the OpenAPI document.

type Plan

type Plan = plan.Request

Types referenced by hook signatures, the plan and the executor.

type Plugin

type Plugin = plugin.Plugin

Plugin hook surface.

type PluginRegistry

type PluginRegistry = plugin.Registry

Plugin hook surface.

type PluginSettings added in v0.18.0

type PluginSettings = config.PluginSettings

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type PluginsConfig

type PluginsConfig = confx.Plugins[config.PluginSettings]

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type Problem

type Problem = server.Problem

Types referenced by hook signatures, the plan and the executor.

type RPC

type RPC = api.RPC

Types referenced by hook signatures, the plan and the executor.

type Relation

type Relation = api.Relation

Types referenced by hook signatures, the plan and the executor.

type RequestHook

type RequestHook = plugin.RequestHook

Plugin hook surface.

type Resource

type Resource = api.Resource

Types referenced by hook signatures, the plan and the executor.

type Result

type Result = exec.Result

Types referenced by hook signatures, the plan and the executor.

type RolesConfig added in v0.18.0

type RolesConfig = confx.Roles

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type Route

type Route = api.Route

Types referenced by hook signatures, the plan and the executor.

type Runtime

type Runtime = server.Runtime

Types referenced by hook signatures, the plan and the executor.

type SchemaConfig

type SchemaConfig = config.Schema

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type ServerConfig

type ServerConfig = config.Server

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type Statement

type Statement = compile.Statement

Types referenced by hook signatures, the plan and the executor.

type TXConfig

type TXConfig = confx.TX

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

type UserError

type UserError = compile.UserError

Types referenced by hook signatures, the plan and the executor.

type WatchConfig

type WatchConfig = confx.Watch

Configuration. Shared section types come from pdbcore/confx; Server is pdbr's own and Schema embeds the shared section (confx.Schema) with pdbr's own keys. Section types carry a Config suffix to avoid clashing with unrelated root-package names.

Directories

Path Synopsis
cmd
pdbr command
Command pdbr serves an automatically mapped REST API for a PostgreSQL database, and provides schema-cache, config, and one-off request tooling.
Command pdbr serves an automatically mapped REST API for a PostgreSQL database, and provides schema-cache, config, and one-off request tooling.
internal
api
Package api turns an introspected catalog into pdbr's resource model: the resources, relations, computed columns, RPCs, enums and composites the server routes to, the lookup tables the parser and compiler consult, the route table, and the OpenAPI document.
Package api turns an introspected catalog into pdbr's resource model: the resources, relations, computed columns, RPCs, enums and composites the server routes to, the lookup tables the parser and compiler consult, the route table, and the OpenAPI document.
compile
Package compile turns a plan.Request into exactly one parameterized SQL statement whose single json column `data` is the response body (or a small wrapper object around it, see Shape).
Package compile turns a plan.Request into exactly one parameterized SQL statement whose single json column `data` is the response body (or a small wrapper object around it, see Shape).
config
Package config defines pdbr's configuration model and its loading rules: YAML file < environment (PDBR_*) < command-line flags.
Package config defines pdbr's configuration model and its loading rules: YAML file < environment (PDBR_*) < command-line flags.
exec
Package exec is the thin glue between the compiled statement and pdbcore/pgexec: it builds the Operation RequestHooks see, applies the read-only gate and the cost limit, compiles through the CompileHook chain, decides the transaction policy, runs the statement, and unwraps the statement's data column into status, headers and body.
Package exec is the thin glue between the compiled statement and pdbcore/pgexec: it builds the Operation RequestHooks see, applies the read-only gate and the cost limit, compiles through the CompileHook chain, decides the transaction policy, runs the statement, and unwraps the statement's data column into status, headers and body.
inflect
Package inflect declares pdbr's naming kinds and its default inflector: raw PostgreSQL identifiers everywhere (PostgREST-style), computed-column keys minus the `<table>_` prefix, relation keys equal to the referenced / referencing table name.
Package inflect declares pdbr's naming kinds and its default inflector: raw PostgreSQL identifiers everywhere (PostgREST-style), computed-column keys minus the `<table>_` prefix, relation keys equal to the referenced / referencing table name.
parse
Package parse turns a matched HTTP request (method, route match, query string, headers) into a fully resolved plan.Request.
Package parse turns a matched HTTP request (method, route match, query string, headers) into a fully resolved plan.Request.
plan
Package plan holds the transport-neutral request plan: what a parsed HTTP request asks for, with every name already resolved against api.Built.
Package plan holds the transport-neutral request plan: what a parsed HTTP request asks for, with every name already resolved against api.Built.
plugin
Package plugin defines pdbr's REST-specific hook surfaces (APIHook, CompileHook, RequestHook) and a Registry that layers their chain helpers on pdbcore/plugin's Registry (Plugin, CatalogHook, InflectionHook).
Package plugin defines pdbr's REST-specific hook surfaces (APIHook, CompileHook, RequestHook) and a Registry that layers their chain helpers on pdbcore/plugin's Registry (Plugin, CatalogHook, InflectionHook).
plugins/advancedfilters
Package advancedfilters is the built-in plugin that opens the relation and computed-column query surface: relation filters (rel.col=op.v, rel!none., rel!every., rel=exists.true|false), related-column ordering (order=rel(col).asc) and computed-column filter/order.
Package advancedfilters is the built-in plugin that opens the relation and computed-column query surface: relation filters (rel.col=op.v, rel!none., rel!every., rel=exists.true|false), related-column ordering (order=rel(col).asc) and computed-column filter/order.
plugins/nestedmutations
Package nestedmutations is the built-in plugin (priority 200) that lets a single-object POST, or a PATCH of a single-row path, write related rows in the same statement: forward relation keys take {"create": {…}} or {"connect": {…}} (and, on a row being updated, {"disconnect": true}, {"update": {…}}, {"delete": true}); backward keys take lists under "create" and "connect" (and, on a row being updated, "update", "delete" and "disconnect"), nested up to max_depth.
Package nestedmutations is the built-in plugin (priority 200) that lets a single-object POST, or a PATCH of a single-row path, write related rows in the same statement: forward relation keys take {"create": {…}} or {"connect": {…}} (and, on a row being updated, {"disconnect": true}, {"update": {…}}, {"delete": true}); backward keys take lists under "create" and "connect" (and, on a row being updated, "update", "delete" and "disconnect"), nested up to max_depth.
plugins/postgis
Package postgis is the built-in plugin (priority 160) that turns PostGIS geometry/geography columns into a query surface: spatial filter operators (st_*, bbox_*), derived pseudo-columns (~<col>_area, ~<col>_centroid, ...), select= projection arguments (transform=, simplify=, buffer=, precision=), distance ordering (order=<col>.st_distance with ~near=) and the ~<col>_st_distance score from ~near=, and the spatial aggregate functions (col.extent(), col.union(), col.collect(), col.centroid(); with aggregates.enabled), and on postgis_raster columns the metadata, pixel value and summary statistics pseudo-columns (~<col>_width, ..., ~<col>_value(band=) at ~near=, ~<col>_summary_stats(band=)) and the intersects filter.
Package postgis is the built-in plugin (priority 160) that turns PostGIS geometry/geography columns into a query surface: spatial filter operators (st_*, bbox_*), derived pseudo-columns (~<col>_area, ~<col>_centroid, ...), select= projection arguments (transform=, simplify=, buffer=, precision=), distance ordering (order=<col>.st_distance with ~near=) and the ~<col>_st_distance score from ~near=, and the spatial aggregate functions (col.extent(), col.union(), col.collect(), col.centroid(); with aggregates.enabled), and on postgis_raster columns the metadata, pixel value and summary statistics pseudo-columns (~<col>_width, ..., ~<col>_value(band=) at ~near=, ~<col>_summary_stats(band=)) and the intersects filter.
plugins/smartcomments
Package smartcomments is the built-in smart_comments plugin: PostGraphile- style tags in database COMMENTs (@omit, @name, @deprecated, @fieldName, ...) customize the REST surface with plain DDL.
Package smartcomments is the built-in smart_comments plugin: PostGraphile- style tags in database COMMENTs (@omit, @name, @deprecated, @fieldName, ...) customize the REST surface with plain DDL.
server
Package server exposes the REST API over HTTP: the router built from the api.Built route table under server.base_path, /healthz and /readyz at the root, GET {base}/openapi.json, problem+json errors, and the middleware chain (recover, timeout, CORS, gzip, body limit, auth).
Package server exposes the REST API over HTTP: the router built from the api.Built route table under server.base_path, /healthz and /readyz at the root, GET {base}/openapi.json, problem+json errors, and the middleware chain (recover, timeout, CORS, gzip, body limit, auth).
testcatalog
Package testcatalog extends the shared pdbcore fixture catalog with the in-memory objects pdbr's hermetic tests need and the fixture database lacks.
Package testcatalog extends the shared pdbcore fixture catalog with the in-memory objects pdbr's hermetic tests need and the fixture database lacks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL