Centralize SQLite connection configuration (#34808)

## What changed

- Add `SqliteConfig` to own the resolved SQLite home, runtime database paths,
  and shared read/write and read-only pool settings.
- Pass the configuration through state and local thread-store consumers,
  replacing standalone path helpers and duplicated connection setup.

GitOrigin-RevId: 7351b08da94b5c8b6c0bbe492f86aeeca0699d3c
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-07-22 18:45:47 +00:00
1 parent a59a419afa
commit 946ed315a4
35 files changed
+445 -397

No files matched your search

+3 -3
View File
@@ -157,7 +157,6 @@ mod tests {
use super::StateRuntime;
use super::test_support::unique_temp_dir;
use crate::migrations::STATE_MIGRATOR;
use crate::state_db_path;
use codex_utils_absolute_path::test_support::PathExt;
use pretty_assertions::assert_eq;
use sqlx::migrate::Migrator;
@@ -344,8 +343,9 @@ mod tests {
table_name: STATE_MIGRATOR.table_name.clone(),
create_schemas: STATE_MIGRATOR.create_schemas.clone(),
};
let pool = crate::SqliteConfig::new_for_testing(codex_home.as_path().abs())
.open_read_write_pool(&state_db_path(codex_home.as_path()))
let sqlite = crate::SqliteConfig::new_for_testing(codex_home.as_path().abs());
let pool = sqlite
.open_read_write_pool(&sqlite.state_db_path())
.await
.expect("open old state db");
old_state_migrator