Skip to main content

upsert_session

Function upsert_session 

Source
pub async fn upsert_session(
    pool: &PgPool,
    session_id: Option<Uuid>,
    visitor_id: &str,
    user_id: Option<Uuid>,
    tenant_id: Option<Uuid>,
    page_url: Option<&str>,
    referrer: Option<&str>,
    user_agent: Option<&str>,
    client_ip: Option<&str>,
    is_bot: bool,
    event_type: &str,
    device_type: Option<&str>,
    browser: Option<&str>,
    os: Option<&str>,
) -> Option<Uuid>
Expand description

Create or update a session for the given visitor.

Returns the session ID (existing or newly created).