Persist auth store into formal tables

This commit is contained in:
2026-05-13 23:24:32 +08:00
parent e8648e45fc
commit 166544fae6
14 changed files with 452 additions and 32 deletions

View File

@@ -57,6 +57,29 @@ impl SpacetimeClient {
.await
}
pub async fn import_auth_store_snapshot_json(
&self,
snapshot_json: String,
updated_at_micros: i64,
) -> Result<AuthStoreSnapshotImportRecord, SpacetimeClientError> {
let procedure_input = AuthStoreSnapshotUpsertInput {
snapshot_json,
updated_at_micros,
};
self.call_after_connect(move |connection, sender| {
connection
.procedures()
.import_auth_store_snapshot_json_then(procedure_input, move |_, result| {
let mapped = result
.map_err(SpacetimeClientError::from_sdk_error)
.and_then(map_auth_store_snapshot_import_procedure_result);
send_once(&sender, mapped);
});
})
.await
}
pub async fn import_auth_store_snapshot(
&self,
) -> Result<AuthStoreSnapshotImportRecord, SpacetimeClientError> {