#![allow(unused)]
fn main() {
use qail_pg::driver::{PgPool, PoolConfig};
let config = PoolConfig::new("localhost", 5432, "user", "db")
.password("secret")
.max_connections(20);
let pool = PgPool::connect(config).await?;
// Acquire connection from pool
let mut conn = pool.acquire().await?;
conn.simple_query("SELECT 1").await?;
// Connection automatically returned when dropped
}
# Pull current schema from database
qail pull postgres://user:pass@localhost/db > schema.qail
# Create a new version with changes
# (edit schema.qail manually)
# Diff and apply
qail diff old.qail new.qail
qail migrate up old.qail:new.qail postgres://...