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 querysearch_query
- Text to search for in alert fieldsorg_id
- Optional organization ID to filter alerts
§Returns
Ok(i64)
- Count of matching alertsErr(anyhow::Error)
- Failed to count alerts