bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
17 lines
577 B
Rust
17 lines
577 B
Rust
use sqlx::{postgres::PgPoolOptions, PgPool};
|
|
use std::time::Duration;
|
|
|
|
pub async fn create_pool(database_url: &str) -> Result<PgPool, sqlx::Error> {
|
|
PgPoolOptions::new()
|
|
.max_connections(10)
|
|
.acquire_timeout(Duration::from_secs(30))
|
|
.idle_timeout(Duration::from_secs(300))
|
|
.connect(database_url)
|
|
.await
|
|
}
|
|
|
|
pub async fn run_migrations(pool: &PgPool) -> Result<(), sqlx::migrate::MigrateError> {
|
|
// Migrations are run from the workspace root where migrations/ folder exists
|
|
sqlx::migrate!("../../migrations").run(pool).await
|
|
}
|