insert_observation

Function insert_observation 

Source
pub(crate) async fn insert_observation(
    pool: &PgPool,
    reflector: &str,
    module: Option<&str>,
    callsign: &str,
    source: &str,
    observed_at: DateTime<Utc>,
) -> Result<(), Error>
Expand description

Inserts a single activity observation.

Each call appends one row. Callers should batch observations where possible to reduce round-trips, but individual inserts are acceptable for real-time Tier 2 events.

ยงErrors

Returns sqlx::Error on connection or foreign-key constraint failures (the referenced reflector must exist in the reflectors table).