mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
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:
1 parent
a59a419afa
commit
946ed315a4
35 files changed
+445
-397
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user