mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-14 23:22:51 +00:00
Merge pull request #761 from fabro-sh/codex/strict-legacy-blob-import
Import legacy blobs strictly into SQLite
This commit is contained in:
commit
891eb43e9a
4 changed files with 1564 additions and 1 deletions
|
|
@ -77,6 +77,13 @@ impl BlobStore {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn sqlite_pool_for_legacy_import(&self) -> Option<&SqlitePool> {
|
||||
match &self.backend {
|
||||
BlobBackend::Slate(_) => None,
|
||||
BlobBackend::Sqlite(pool) => Some(pool),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn write(&self, bytes: &[u8]) -> Result<BlobHash> {
|
||||
match &self.backend {
|
||||
BlobBackend::Slate(repo) => {
|
||||
|
|
|
|||
1554
lib/components/fabro-store/src/legacy_blob_import.rs
Normal file
1554
lib/components/fabro-store/src/legacy_blob_import.rs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -5,6 +5,7 @@ mod blob_store;
|
|||
mod error;
|
||||
mod keyed_mutex;
|
||||
mod keys;
|
||||
mod legacy_blob_import;
|
||||
mod record;
|
||||
mod run_sessions;
|
||||
mod run_state;
|
||||
|
|
@ -25,6 +26,7 @@ pub use fabro_types::{
|
|||
BlobHash, EventEnvelope, PendingInterviewRecord, Run, RunProjection, StageId, StageProjection,
|
||||
};
|
||||
pub use keyed_mutex::{KeyedMutex, KeyedMutexGuard};
|
||||
pub use legacy_blob_import::{LegacyBlobImportError, LegacyBlobImportReport};
|
||||
pub use run_sessions::{
|
||||
ProjectedRunSession, project_run_session, project_run_session_with_context,
|
||||
project_run_sessions,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ impl Database {
|
|||
self.base_prefix.clone()
|
||||
}
|
||||
|
||||
async fn open_db(&self) -> Result<slatedb::Db> {
|
||||
pub(crate) async fn open_db(&self) -> Result<slatedb::Db> {
|
||||
let db = self
|
||||
.db
|
||||
.get_or_try_init(|| async {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue