Skip to main content

Module db

Module db 

Source

Structs§

CursorPage
Response metadata for cursor-based pagination.
DatabaseManager
Multi-database connection manager. Maps connection names to SQL connections.
FilterParam
A single filter parameter parsed from ?filter[field]=value.
FilterSet
A set of filter parameters for a query.
MongoBackedStore
MongoDB-backed resource store (M14).
MongoConnection
A MongoDB connection wrapping a database handle.
OffsetPage
Response metadata for offset-based pagination.
OrmBackedStore
ORM-backed store (M14). Delegates to OrmResourceQuery using a per-resource connection.
OrmResourceQuery
ORM-backed resource query. Executes dialect-aware SQL via SeaORM. Supports Postgres, MySQL, and SQLite backends.
ResourceQuery
Dynamic query executor for a resource defined by a ResourceDefinition.
ResourceRow
A single row returned from a resource query, represented as a JSON object.
SearchParam
Full-text search parameter using PostgreSQL to_tsvector.
SortField
A single field + direction sort instruction.
SortParam
Parsed sort parameters from ?sort=-created_at,name.
SqlConnection
A single SQL database connection (SeaORM). Used for CRUD via ORM; migrations may use the underlying pool separately.

Enums§

PageRequest
Request parameters for pagination.
SortDirection
Sort direction for a field.

Traits§

ResourceStore
Typed resource store implemented by generated per-resource query modules or OrmBackedStore (M14).

Functions§

build_create_table_sql
Builds a SQL CREATE TABLE statement from a ResourceDefinition (Postgres).
build_create_table_sql_for_engine
Builds a SQL CREATE TABLE statement for the given engine (M14 multi-DB).
build_multi_store_registry
Builds a store registry supporting both SQL and MongoDB backends (M14 full multi-DB).
build_orm_store_registry
Builds a store registry from DatabaseManager and resources (M14 ORM path). Each resource gets an OrmBackedStore using the connection for its db (or default).
create_pool
Creates a PostgreSQL connection pool from the given database URL.
decode_cursor
Decodes a cursor string (base64-encoded UUID) to a UUID string.
encode_cursor
Encodes a UUID string as a base64 cursor.
health_check
Runs a simple SELECT 1 health check against the pool.
parse_embedded_json
parse_filter
parse_filter_text
parse_optional_json
require_field
row_from_model
run_migrations
Runs all pending SQL migrations from the given directory (legacy single-DB mode).
run_migrations_multi
Run migrations on all SQL engines in the DatabaseManager (M14 multi-DB mode).
sort_direction_at
sort_field_at

Type Aliases§

StoreRegistry

Attribute Macros§

async_trait