apalis_sqlite/queries/mod.rs
1//! Module for various query implementations for the SQLite backend.
2//!
3//! Each submodule contains specific query logic used by the backend.
4use apalis_core::backend::StatType;
5/// Fetch tasks by their IDs
6pub mod fetch_by_id;
7/// Keep workers alive by updating their heartbeat
8pub mod keep_alive;
9/// List available queues
10pub mod list_queues;
11/// List tasks in a specific queue
12pub mod list_tasks;
13/// List workers
14pub mod list_workers;
15/// Metrics related queries
16pub mod metrics;
17/// Re-enqueue orphaned tasks that were being processed by dead workers
18pub mod reenqueue_orphaned;
19/// Register a new worker in the database
20pub mod register_worker;
21/// Vacuum the database to optimize space
22pub mod vacuum;
23/// Wait for tasks to complete and stream their results
24pub mod wait_for;
25
26/// Convert a string representation of a stat type to the corresponding `StatType` enum variant
27fn stat_type_from_string(s: &str) -> StatType {
28 match s {
29 "Decimal" => StatType::Decimal,
30 "Percentage" => StatType::Percentage,
31 "Timestamp" => StatType::Timestamp,
32 _ => StatType::Number, // default fallback
33 }
34}