Seeds legacy rows and clears the backfill marker so the next open re-runs the pass against them (a fresh store marks itself done immediately because it has nothing to backfill).
(
project: &std::path::Path,
provider: &str,
messages: &[SessionMessageRecord],
)
| 94 | /// the pass against them (a fresh store marks itself done immediately because |
| 95 | /// it has nothing to backfill). |
| 96 | async fn seed_legacy_rows( |
| 97 | project: &std::path::Path, |
| 98 | provider: &str, |
| 99 | messages: &[SessionMessageRecord], |
| 100 | ) { |
| 101 | let db = open_project_session_db(project).await.unwrap(); |
| 102 | assert!(db.upsert_session(&session(provider)).await); |
| 103 | for message in messages { |
| 104 | assert!(db.upsert_session_message(message).await); |
| 105 | } |
| 106 | drop(db); |
| 107 | |
| 108 | let raw = libsql::Builder::new_local(project_session_db_path(project)) |
| 109 | .build() |
| 110 | .await |
| 111 | .unwrap(); |
| 112 | let conn = raw.connect().unwrap(); |
| 113 | conn.execute( |
| 114 | "DELETE FROM session_schema_migrations WHERE name = 'transcript_facts_backfill'", |
| 115 | (), |
| 116 | ) |
| 117 | .await |
| 118 | .unwrap(); |
| 119 | } |
| 120 | |
| 121 | async fn marker_version(project: &std::path::Path) -> Option<i64> { |
| 122 | let raw = libsql::Builder::new_local(project_session_db_path(project)) |
no test coverage detected