mirror of
https://github.com/openai/codex.git
synced 2026-04-24 22:54:54 +00:00
feat: sqlite 1 (#10004)
Add a `.sqlite` database to be used to store rollout metatdata (and later logs) This PR is phase 1: * Add the database and the required infrastructure * Add a backfill of the database * Persist the newly created rollout both in files and in the DB * When we need to get metadata or a rollout, consider the `JSONL` as the source of truth but compare the results with the DB and show any errors
This commit is contained in:
@@ -28,6 +28,28 @@ impl ThreadId {
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<&str> for ThreadId {
|
||||
type Error = uuid::Error;
|
||||
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
Self::from_string(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl TryFrom<String> for ThreadId {
|
||||
type Error = uuid::Error;
|
||||
|
||||
fn try_from(value: String) -> Result<Self, Self::Error> {
|
||||
Self::from_string(value.as_str())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<ThreadId> for String {
|
||||
fn from(value: ThreadId) -> Self {
|
||||
value.to_string()
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for ThreadId {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
@@ -36,7 +58,7 @@ impl Default for ThreadId {
|
||||
|
||||
impl Display for ThreadId {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{}", self.uuid)
|
||||
Display::fmt(&self.uuid, f)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user