Box the shared SQLite pool-opening future (#63331)

## What changed

Have `open_read_write_pool_with_spec` return a pinned, boxed `Send` future.
Keep the shared setup and recovery logic for runtime and standalone database
callers in `open_pool_inner`.

GitOrigin-RevId: 4ceca053e76fa1d497259c52c12d422fd3fa2554
This commit is contained in:
Charlie Marsh
2026-11-23 12:54:16 +00:00
committed by copyberry
parent 114c086d6d
commit 9819b5c869
+12 -1
View File
@@ -27,6 +27,7 @@ use sqlx::sqlite::SqlitePoolOptions;
use sqlx::sqlite::SqliteSynchronous;
use std::path::Path;
use std::path::PathBuf;
use std::pin::Pin;
use std::sync::Arc;
use std::time::Duration;
use std::time::Instant;
@@ -474,7 +475,17 @@ impl SqliteConfig {
.await
}
async fn open_read_write_pool_with_spec(
// Share SQLite setup and recovery between the runtime and standalone database owners.
fn open_read_write_pool_with_spec<'a>(
&'a self,
path: &'a Path,
recover_spec: Option<RuntimeDbSpec>,
telemetry_override: Option<&'a dyn DbTelemetry>,
) -> Pin<Box<dyn Future<Output = anyhow::Result<SqlitePool>> + Send + 'a>> {
Box::pin(self.open_pool_inner(path, recover_spec, telemetry_override))
}
async fn open_pool_inner(
&self,
path: &Path,
recover_spec: Option<RuntimeDbSpec>,