OxiFY Storage - SQLite persistence layer
This crate provides database storage for workflows and executions using SQLite.
Architecture Overview
Connection Pooling Strategy
The storage layer uses sqlx::SqlitePool for connection management with the following strategy:
Configuration
- Max Connections: Configurable (default: 10) - Upper limit of connections in pool
- Min Connections: Configurable (default: 2) - Minimum idle connections to maintain
- Acquire Timeout: 30 seconds - Maximum time to wait for an available connection
Best Practices
- Use WAL mode for better concurrency
- Keep transactions short
- Use pool methods, never create direct connections
Example:
let config = DatabaseConfig {
database_url: "sqlite:oxify.db?mode=rwc".to_string(),
max_connections: 20,
min_connections: 5,
};
let pool = DatabasePool::new(config).await?;