moonbitstack/moondb/apool does not have a README file
pub struct AsyncPool[D] {
// private fields
}let pool : @apool.AsyncPool[@postgres.PgConn] = @apool.AsyncPool::new(
() => @postgres.PgConn::connect("db", 5432, "app", "secret", "app"),
max_size=8,
overflow=2,
pre_ping=true,
acquire_timeout_ms=3000L,
reset=conn => conn.rollback() catch { _ => () },
)
let rows = pool.with_conn(conn => conn.query("SELECT 1", []))fn[D] AsyncPool::new(make : async () -> D raise DbError, max_size? : Int, overflow? : Int, max_lifetime_ms? : Int64, pre_ping? : Bool, acquire_timeout_ms? : Int64, clock? : () -> Int64, ward? : Ward, reset? : async (D) -> Unit raise DbError, rand? : () -> Double, cpu? : () -> Int) -> AsyncPool[D] raise DbErrorInstall
Download zipThe standard database-access interface for MoonBit — the driver↔query-layer contract, transliterated from Go's database/sql/driver and Python's DB-API 2.0. ORMs (moonorm) build on it; drivers (moonsqlite / moonpostgres / moonmysql) implement it.