0.1.0-pre.004
This commit is contained in:
@@ -0,0 +1,57 @@
|
||||
// file: kb-store/src/postgres/repository/core_extraction_repository.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL atomic canonical transaction to core extraction repository.
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::CoreExtractionStore for crate::PostgresStore {
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_raw_transactions_for_core_extraction(
|
||||
&self,
|
||||
filter: &crate::CoreExtractionSelectionFilter,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::RawTransactionRow>> {
|
||||
return crate::postgres::query::list_raw_transactions_for_core_extraction(
|
||||
self.pool(),
|
||||
filter,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn is_core_extraction_current(
|
||||
&self,
|
||||
identity: &crate::ProcessingLedgerIdentity,
|
||||
) -> kb_core::Result<bool> {
|
||||
return crate::postgres::query::is_core_extraction_current(self.pool(), identity).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn persist_core_extraction(
|
||||
&self,
|
||||
bundle: &crate::CoreExtractionBundle,
|
||||
force_replay: bool,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::persist_core_extraction(self.pool(), bundle, force_replay)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn mark_core_extraction_failed(
|
||||
&self,
|
||||
failure: &crate::CoreExtractionFailure,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::mark_core_extraction_failed(self.pool(), failure).await;
|
||||
}
|
||||
}
|
||||
118
kb-store/src/postgres/repository/core_transaction_repository.rs
Normal file
118
kb-store/src/postgres/repository/core_transaction_repository.rs
Normal file
@@ -0,0 +1,118 @@
|
||||
// file: kb-store/src/postgres/repository/core_transaction_repository.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL core Solana repository implementation.
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::CoreTransactionStore for crate::PostgresStore {
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_transaction(
|
||||
&self,
|
||||
input: &crate::CoreTransactionInsert,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_transaction(self.pool(), input).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_account_keys(
|
||||
&self,
|
||||
inputs: &[crate::CoreAccountKeyInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_account_keys(self.pool(), inputs).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_instructions(
|
||||
&self,
|
||||
inputs: &[crate::CoreInstructionInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_instructions(self.pool(), inputs).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_inner_instructions(
|
||||
&self,
|
||||
inputs: &[crate::CoreInnerInstructionInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_inner_instructions(self.pool(), inputs).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_logs(
|
||||
&self,
|
||||
inputs: &[crate::CoreLogInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_logs(self.pool(), inputs).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_core_balance_changes(
|
||||
&self,
|
||||
inputs: &[crate::CoreBalanceChangeInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_core_balance_changes(self.pool(), inputs).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_core_instructions_for_replay(
|
||||
&self,
|
||||
filter: &crate::CoreInstructionReplayFilter,
|
||||
page_request: &crate::PageRequest,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::CoreInstructionRow>> {
|
||||
return crate::postgres::query::list_core_instructions_for_replay(
|
||||
self.pool(),
|
||||
filter,
|
||||
page_request,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_core_instruction_replay_inputs(
|
||||
&self,
|
||||
filter: &crate::CoreInstructionReplayFilter,
|
||||
page_request: &crate::PageRequest,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::CoreInstructionReplayInput>> {
|
||||
return crate::postgres::query::list_core_instruction_replay_inputs(
|
||||
self.pool(),
|
||||
filter,
|
||||
page_request,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn mark_core_instruction_lifecycle(
|
||||
&self,
|
||||
mark: &crate::CoreInstructionLifecycleMark,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::update_core_instruction_lifecycle(self.pool(), mark).await;
|
||||
}
|
||||
}
|
||||
115
kb-store/src/postgres/repository/decode_pipeline_repository.rs
Normal file
115
kb-store/src/postgres/repository/decode_pipeline_repository.rs
Normal file
@@ -0,0 +1,115 @@
|
||||
// file: kb-store/src/postgres/repository/decode_pipeline_repository.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL contextual decode and materialization repository.
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::DecodePipelineStore for crate::PostgresStore {
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_decode_inputs(
|
||||
&self,
|
||||
filter: &crate::DecodeSelectionFilter,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::CoreInstructionReplayInput>> {
|
||||
return crate::postgres::query::list_decode_inputs(self.pool(), filter).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn is_decode_current(
|
||||
&self,
|
||||
identity: &crate::ProcessingLedgerIdentity,
|
||||
) -> kb_core::Result<bool> {
|
||||
return crate::postgres::query::is_decode_current(self.pool(), identity).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn persist_decode_coverage_declarations(
|
||||
&self,
|
||||
declarations: &[crate::DecodeCoverageDeclarationInsert],
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::persist_decode_coverage_declarations(
|
||||
self.pool(),
|
||||
declarations,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn persist_decode_result(
|
||||
&self,
|
||||
bundle: &crate::DecodePersistenceBundle,
|
||||
force_replay: bool,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::persist_decode_result(self.pool(), bundle, force_replay)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn mark_decode_failed(
|
||||
&self,
|
||||
failure: &crate::DecodeFailure,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::mark_decode_failed(self.pool(), failure).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn persist_materialization_result(
|
||||
&self,
|
||||
bundle: &crate::MaterializationPersistenceBundle,
|
||||
force_replay: bool,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::persist_materialization_result(
|
||||
self.pool(),
|
||||
bundle,
|
||||
force_replay,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_decode_coverage_summary(
|
||||
&self,
|
||||
processor_name: std::option::Option<&str>,
|
||||
processor_version: std::option::Option<&str>,
|
||||
limit: u32,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::DecodeCoverageSummaryRow>> {
|
||||
return crate::postgres::query::list_decode_coverage_summary(
|
||||
self.pool(),
|
||||
processor_name,
|
||||
processor_version,
|
||||
limit,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn list_materialized_events(
|
||||
&self,
|
||||
filter: &crate::MaterializedEventFilter,
|
||||
) -> kb_core::Result<std::vec::Vec<crate::MaterializedEventQueryRow>> {
|
||||
return crate::postgres::query::list_materialized_events(self.pool(), filter).await;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
// file: kb-store/src/postgres/repository/raw_transaction_repository.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL canonical transaction and acquisition observation repository implementation.
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::RawTransactionStore for crate::PostgresStore {
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn has_raw_transaction_signature(
|
||||
&self,
|
||||
signature: &kb_lib::Signature,
|
||||
) -> kb_core::Result<bool> {
|
||||
return crate::postgres::query::has_raw_transaction_signature(
|
||||
self.pool(),
|
||||
signature.0.as_str(),
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn has_transaction_observation_key(
|
||||
&self,
|
||||
observation_key: &str,
|
||||
) -> kb_core::Result<bool> {
|
||||
return crate::postgres::query::has_transaction_observation_key(
|
||||
self.pool(),
|
||||
observation_key,
|
||||
)
|
||||
.await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_raw_transaction(
|
||||
&self,
|
||||
input: &crate::RawTransactionInsert,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_raw_transaction(self.pool(), input).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn insert_transaction_observation(
|
||||
&self,
|
||||
input: &crate::TransactionObservationInsert,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::insert_transaction_observation(self.pool(), input).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn mark_raw_payload_lifecycle(
|
||||
&self,
|
||||
mark: &crate::RawPayloadLifecycleMark,
|
||||
) -> kb_core::Result<crate::InsertOutcome> {
|
||||
return crate::postgres::query::update_raw_payload_lifecycle(self.pool(), mark).await;
|
||||
}
|
||||
}
|
||||
31
kb-store/src/postgres/repository/store_health_repository.rs
Normal file
31
kb-store/src/postgres/repository/store_health_repository.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
// file: kb-store/src/postgres/repository/store_health_repository.rs
|
||||
// version: 1
|
||||
|
||||
//! PostgreSQL store health repository implementation.
|
||||
|
||||
#[async_trait::async_trait]
|
||||
impl crate::StoreHealthStore for crate::PostgresStore {
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn backend_descriptor(&self) -> kb_core::Result<crate::StoreBackendDescriptor> {
|
||||
return crate::PostgresStore::backend_descriptor(self).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn health_snapshot(&self) -> kb_core::Result<crate::StoreHealthSnapshot> {
|
||||
return crate::PostgresStore::health_snapshot(self).await;
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::implicit_return,
|
||||
reason = "async_trait expansion triggers implicit_return on generated async trait methods."
|
||||
)]
|
||||
async fn migration_snapshot(&self) -> kb_core::Result<crate::StoreMigrationSnapshot> {
|
||||
return crate::PostgresStore::migration_snapshot(self).await;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user