Skip to main content

Module pool

Module pool 

Source
Expand description

r2d2 connection pool for the ToolHub SQLite DB.

The pool is wired so every connection it hands out has the sqlite-vec extension auto-loaded (via crate::ensure_vec_extension) and finds the schema already migrated. Open the pool once at startup and clone it into axum/tower handlers.

Functionsยง

open_pool
Open and migrate the DB at path, returning a ready-to-use connection pool. Migrations run on a single bootstrap connection that is dropped before the pool is built, so pooled handles never see a half-applied DB.