insert_stream

Function insert_stream 

Source
pub(crate) async fn insert_stream(
    pool: &PgPool,
    stream: &NewStream<'_>,
) -> Result<i64, Error>
Expand description

Inserts a new stream row and returns its auto-generated id.

Called by Tier 3 when a D-STAR voice header arrives. The row is created with audio_mp3 = NULL, ended_at = NULL, and upload_status = 'pending'. The returned id is used by subsequent update_audio calls.

ยงErrors

Returns sqlx::Error on connection or constraint failures.