v0.3.8-pre.009
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// file: crates/ksp-store-postgres-lib/src/runtime.rs
|
||||
// version: 17
|
||||
// version: 18
|
||||
|
||||
const APPLICATION_NAME: &str = "ksp-store";
|
||||
const MAX_CONNECTION_URI_BYTES: usize = 4_096;
|
||||
@@ -356,6 +356,14 @@ impl PostgresBackend {
|
||||
return crate::inspect_raw_account_states(&self.pool, &self.network, query).await;
|
||||
}
|
||||
|
||||
/// Inspects one safe random-access RAW account-observation window with exact logical counts.
|
||||
pub async fn inspect_raw_account_observations(
|
||||
&self,
|
||||
query: &ksp_store_api::RawAccountObservationInspectionQuery,
|
||||
) -> std::result::Result<ksp_store_api::RawInspectionPage<ksp_store_api::RawAccountObservationSummary>, crate::PostgresBackendError> {
|
||||
return crate::inspect_raw_account_observations(&self.pool, &self.network, query).await;
|
||||
}
|
||||
|
||||
/// Reads one persisted RAW account observation by producer-owned idempotence key.
|
||||
pub async fn get_raw_account_observation(
|
||||
&self,
|
||||
@@ -405,6 +413,14 @@ impl PostgresBackend {
|
||||
return crate::inspect_raw_transactions(&self.pool, &self.network, query).await;
|
||||
}
|
||||
|
||||
/// Inspects one safe random-access RAW transaction-observation window with exact logical counts.
|
||||
pub async fn inspect_raw_transaction_observations(
|
||||
&self,
|
||||
query: &ksp_store_api::RawTransactionObservationInspectionQuery,
|
||||
) -> std::result::Result<ksp_store_api::RawInspectionPage<ksp_store_api::RawTransactionObservationSummary>, crate::PostgresBackendError> {
|
||||
return crate::inspect_raw_transaction_observations(&self.pool, &self.network, query).await;
|
||||
}
|
||||
|
||||
/// Reads one persisted RAW transaction observation by producer-owned idempotence key.
|
||||
pub async fn get_raw_transaction_observation(
|
||||
&self,
|
||||
@@ -485,6 +501,18 @@ impl std::fmt::Debug for PostgresBackend {
|
||||
}
|
||||
}
|
||||
|
||||
impl ksp_store_api::RawAccountObservationInspectionRead for PostgresBackend {
|
||||
fn inspect_raw_account_observations<'a>(
|
||||
&'a self,
|
||||
query: &'a ksp_store_api::RawAccountObservationInspectionQuery,
|
||||
) -> ksp_store_api::StoreApiFuture<'a, ksp_store_api::Result<ksp_store_api::RawInspectionPage<ksp_store_api::RawAccountObservationSummary>>> {
|
||||
return std::boxed::Box::pin(async move {
|
||||
let result = PostgresBackend::inspect_raw_account_observations(self, query).await;
|
||||
return result.map_err(map_capability_error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl ksp_store_api::RawAccountObservationRead for PostgresBackend {
|
||||
fn get_raw_account_observation<'a>(
|
||||
&'a self,
|
||||
@@ -604,6 +632,18 @@ impl ksp_store_api::RawTransactionWrite for PostgresBackend {
|
||||
}
|
||||
}
|
||||
|
||||
impl ksp_store_api::RawTransactionObservationInspectionRead for PostgresBackend {
|
||||
fn inspect_raw_transaction_observations<'a>(
|
||||
&'a self,
|
||||
query: &'a ksp_store_api::RawTransactionObservationInspectionQuery,
|
||||
) -> ksp_store_api::StoreApiFuture<'a, ksp_store_api::Result<ksp_store_api::RawInspectionPage<ksp_store_api::RawTransactionObservationSummary>>> {
|
||||
return std::boxed::Box::pin(async move {
|
||||
let result = PostgresBackend::inspect_raw_transaction_observations(self, query).await;
|
||||
return result.map_err(map_capability_error);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
impl ksp_store_api::RawTransactionObservationRead for PostgresBackend {
|
||||
fn get_raw_transaction_observation<'a>(
|
||||
&'a self,
|
||||
|
||||
Reference in New Issue
Block a user