pub async fn db_test_connection(url: &str, benchmark: bool) -> Result<()>Expand description
Test database connection with optional benchmarking.
Connects to the database and verifies connectivity. If benchmark mode is enabled, runs 10 test queries and reports latency statistics.
§Arguments
url- Database connection URLbenchmark- Whether to run latency benchmark (10 queries)
§Supported Databases
- PostgreSQL (fully supported)
- MySQL (planned)
§Examples
// Simple connection test
db_test_connection("postgresql://localhost/celers", false).await?;
// With latency benchmark
db_test_connection("postgresql://localhost/celers", true).await?;