Function count_search_alerts

Source
pub async fn count_search_alerts(
    pool: &Pool<MySql>,
    search_query: &str,
    org_id: Option<i64>,
) -> Result<i64>
Expand description

Gets the count of matching alerts for a search query.

This function counts the number of alerts that match a specific search query, which is useful for pagination in search results.

§Arguments

  • pool - Database connection pool for executing the query
  • search_query - Text to search for in alert fields
  • org_id - Optional organization ID to filter alerts

§Returns

  • Ok(i64) - Count of matching alerts
  • Err(anyhow::Error) - Failed to count alerts