Module db

Module db 

Source
Expand description

Database connection pool, schema migrations, and typed query modules.

This module manages the PostgreSQL connection pool via sqlx and provides the schema migration entry point. Submodules contain typed query functions for each table:

ModuleTablePurpose
reflectorsreflectorsRegistry of discovered D-STAR reflectors.
activityactivity_logTimestamped callsign observations.
connected_nodesconnected_nodesLive snapshot of linked nodes per reflector.
streamsstreamsCaptured voice transmissions with audio.
uploadsstreamsUpload queue lifecycle management.

The pool is shared across all tiers via sqlx::PgPool, which is cheaply cloneable (it wraps an Arc internally).

Modulesยง

activity ๐Ÿ”’
Query functions for the activity_log table.
connected_nodes ๐Ÿ”’
Query functions for the connected_nodes table.
migrations ๐Ÿ”’
Embedded SQL schema migrations.
reflectors ๐Ÿ”’
Query functions for the reflectors table.
streams ๐Ÿ”’
Query functions for the streams table.
uploads ๐Ÿ”’
Query functions for the stream upload queue.

Functionsยง

connect ๐Ÿ”’
Creates and returns a PostgreSQL connection pool.
migrate ๐Ÿ”’
Runs embedded database migrations.