apalis_sql/lib.rs
1#![doc=include_str!("../README.md")]
2use apalis_core::backend::StatType;
3
4/// SQL backend for Apalis
5pub mod config;
6/// SQL context for jobs stored in a SQL database
7pub mod context;
8/// DateTime abstraction for unified time handling
9pub mod datetime;
10/// SQL task row representation and conversion
11pub mod from_row;
12
13/// Extension traits for `TaskBuilder`
14pub mod ext;
15
16pub use datetime::{DateTime, DateTimeExt};
17pub use from_row::TaskRow;
18
19/// Convert a string to a StatType
20#[must_use]
21pub fn stat_type_from_string(s: &str) -> StatType {
22 match s {
23 // "Number" => StatType::Number,
24 "Decimal" => StatType::Decimal,
25 "Percentage" => StatType::Percentage,
26 "Timestamp" => StatType::Timestamp,
27 _ => StatType::Number,
28 }
29}