Working first implementation

This commit is contained in:
Clément Renault 2025-06-14 11:39:53 +02:00 committed by Kerollmops
parent e74c3b692a
commit e023ee4b6b
No known key found for this signature in database
GPG key ID: F250A4C4E3AE5F5F
15 changed files with 298 additions and 103 deletions

View file

@ -212,19 +212,20 @@ impl<'a> Dump<'a> {
KindWithContent::DumpCreation { keys, instance_uid }
}
KindDump::SnapshotCreation => KindWithContent::SnapshotCreation,
KindDump::Export { url, indexes, skip_embeddings, api_key } => {
KindWithContent::Export {
url,
indexes: indexes
.into_iter()
.map(|index| {
IndexUidPattern::try_from(index).map_err(|_| Error::CorruptedDump)
})
.collect::<Result<Vec<_>, Error>>()?,
skip_embeddings,
api_key,
}
}
KindDump::Export { url, indexes, api_key } => KindWithContent::Export {
url,
api_key,
indexes: indexes
.into_iter()
.map(|(pattern, settings)| {
Ok((
IndexUidPattern::try_from(pattern)
.map_err(|_| Error::CorruptedDump)?,
settings,
))
})
.collect::<Result<_, Error>>()?,
},
KindDump::UpgradeDatabase { from } => KindWithContent::UpgradeDatabase { from },
},
};