postrust-server 3.1.0

PostgREST-compatible REST and GraphQL API server for PostgreSQL, built on Axum
Documentation
//! Postrust Server library.
//!
//! This crate provides the HTTP server implementation for Postrust.
//!
//! ## Features
//!
//! - `graphql` - Serves the GraphQL API at `/v1/graphql`, with Hasura's
//!   contract, subscriptions and Apollo Federation.
//! - `admin-ui` - Implies `graphql`, and enables the admin UI with OpenAPI documentation,
//!   Swagger UI, Scalar, and GraphQL Playground at `/admin`.
//! - `otel` - OpenTelemetry: traces and metrics exported over OTLP, and the
//!   metrics as Prometheus text at `/metrics` on the admin port. Inactive
//!   until configured; see [`otel`] and docs/observability.md.

#![warn(missing_docs)]
// Every fallible function in this crate returns `postrust_core::Error`, which
// is a wide enum by design: a PostgREST error carries its code, message,
// details and hint. Boxing it to satisfy the lint would put an allocation on
// the error path of every request to save a return slot on the success path.
// `postrust-core` takes the same position at its own crate root; this was
// being restated a dozen times a file instead.
#![allow(clippy::result_large_err)]

pub mod app;
pub mod build;
pub mod custom;
mod error;
mod jwks;
pub mod lenient_uri;
#[cfg(feature = "otel")]
pub mod otel;
pub mod state;
pub mod telemetry;
mod user;

#[cfg(feature = "admin-ui")]
pub mod admin;

pub use app::handle_request;
pub use build::{build, App, Builder, Host, RESERVED_PREFIXES};
pub use error::Error;
pub use state::{AppState, TxOptions};
pub use user::User;

#[cfg(feature = "admin-ui")]
pub use admin::admin_router;