112 lines
5.4 KiB
Rust
112 lines
5.4 KiB
Rust
// file: kb-store/src/postgres.rs
|
|
// version: 3
|
|
|
|
//! PostgreSQL storage implementation boundary.
|
|
|
|
mod migrations;
|
|
mod query;
|
|
mod replay_candidates;
|
|
mod repository;
|
|
mod store;
|
|
#[cfg(test)]
|
|
mod test_serial;
|
|
|
|
/// Allowed Solana table domains encoded in table names.
|
|
pub use self::migrations::ALLOWED_SOLANA_TABLE_DOMAINS;
|
|
/// Core account key table name.
|
|
pub use self::migrations::CORE_ACCOUNT_KEYS_TABLE_NAME;
|
|
/// Core balance change table name.
|
|
pub use self::migrations::CORE_BALANCE_CHANGES_TABLE_NAME;
|
|
/// Core inner instruction table name.
|
|
pub use self::migrations::CORE_INNER_INSTRUCTIONS_TABLE_NAME;
|
|
/// Core instruction table name.
|
|
pub use self::migrations::CORE_INSTRUCTIONS_TABLE_NAME;
|
|
/// Core log table name.
|
|
pub use self::migrations::CORE_LOGS_TABLE_NAME;
|
|
/// Core Solana table names introduced by `0.2.4`.
|
|
pub use self::migrations::CORE_STORE_TABLE_NAMES;
|
|
/// Core transaction table name.
|
|
pub use self::migrations::CORE_TRANSACTIONS_TABLE_NAME;
|
|
/// Machine-readable decoder coverage declaration table name.
|
|
pub use self::migrations::DECODE_COVERAGE_DECLARATIONS_TABLE_NAME;
|
|
/// Observed decoder coverage classification table name.
|
|
pub use self::migrations::DECODE_COVERAGE_OBSERVATIONS_TABLE_NAME;
|
|
/// Versioned decoded event table name.
|
|
pub use self::migrations::DECODE_EVENTS_TABLE_NAME;
|
|
/// Decode and materialization table names introduced by `0.4.0`.
|
|
pub use self::migrations::DECODE_STORE_TABLE_NAMES;
|
|
/// Default PostgreSQL schema policy.
|
|
pub use self::migrations::DEFAULT_SCHEMA_POLICY;
|
|
/// Versioned materialized output table name.
|
|
pub use self::migrations::MATERIALIZED_EVENTS_TABLE_NAME;
|
|
/// PostgreSQL migration strategy used by this crate.
|
|
pub use self::migrations::MIGRATION_STRATEGY;
|
|
/// Migration table name used by sqlx when migrations are enabled later.
|
|
pub use self::migrations::MIGRATION_TABLE_NAME;
|
|
/// Processing ledger table name.
|
|
pub use self::migrations::PROCESSING_LEDGER_TABLE_NAME;
|
|
/// Table diagnostic metadata.
|
|
pub use self::migrations::PostgresTableDiagnosticSpec;
|
|
/// Canonical transaction acquisition table names active since `0.3.1`.
|
|
pub use self::migrations::RAW_STORE_TABLE_NAMES;
|
|
/// Canonical raw transaction table name.
|
|
pub use self::migrations::RAW_TRANSACTIONS_TABLE_NAME;
|
|
/// Solana application table prefix.
|
|
pub use self::migrations::SOLANA_TABLE_PREFIX;
|
|
/// Advisory lock id used while initializing store schemas.
|
|
pub use self::migrations::STORE_SCHEMA_ADVISORY_LOCK_ID;
|
|
/// Transaction acquisition observation table name.
|
|
pub use self::migrations::TRANSACTION_OBSERVATIONS_TABLE_NAME;
|
|
/// Core store SQL statements applied by the idempotent initializer.
|
|
pub use self::migrations::core_store_schema_statements;
|
|
/// Core table diagnostic specs.
|
|
pub use self::migrations::core_store_table_diagnostic_specs;
|
|
/// Decode and materialization SQL statements applied by the idempotent initializer.
|
|
pub use self::migrations::decode_store_schema_statements;
|
|
/// Decode and materialization table diagnostic specs.
|
|
pub use self::migrations::decode_store_table_diagnostic_specs;
|
|
/// Returns true when a Solana table name follows the canonical prefix and domain rules.
|
|
pub use self::migrations::is_valid_solana_table_name;
|
|
/// Canonical transaction acquisition SQL statements applied by the initializer.
|
|
pub use self::migrations::raw_store_schema_statements;
|
|
/// Canonical transaction acquisition diagnostic specs.
|
|
pub use self::migrations::raw_store_table_diagnostic_specs;
|
|
/// Validates core store table names.
|
|
pub use self::migrations::validate_core_store_table_names;
|
|
/// Validates decode and materialization store table names.
|
|
pub use self::migrations::validate_decode_store_table_names;
|
|
/// Validates canonical transaction acquisition table names.
|
|
pub use self::migrations::validate_raw_store_table_names;
|
|
/// Validates a canonical Solana table name.
|
|
pub use self::migrations::validate_solana_table_name;
|
|
/// Maximum number of rows returned by one replay candidate query.
|
|
pub use self::replay_candidates::MAX_REPLAY_CANDIDATE_ROWS;
|
|
/// Bounded read-only filter for core entity summaries.
|
|
pub use self::replay_candidates::PostgresReplayEntityFilter;
|
|
/// Core entity kind used while filtering replay candidates.
|
|
pub use self::replay_candidates::PostgresReplayEntityKind;
|
|
/// Aggregated mint, owner or account-key occurrences from core tables.
|
|
pub use self::replay_candidates::PostgresReplayEntitySummary;
|
|
/// Bounded read-only filter for program summaries.
|
|
pub use self::replay_candidates::PostgresReplayProgramFilter;
|
|
/// Program occurrence scope used while filtering replay candidates.
|
|
pub use self::replay_candidates::PostgresReplayProgramScope;
|
|
/// Aggregated program occurrences across outer, inner and linked logs.
|
|
pub use self::replay_candidates::PostgresReplayProgramSummary;
|
|
/// One raw transaction candidate enriched with core and ledger diagnostics.
|
|
pub use self::replay_candidates::PostgresReplayTransactionCandidate;
|
|
/// Bounded read-only filter for transaction replay candidates.
|
|
pub use self::replay_candidates::PostgresReplayTransactionFilter;
|
|
/// PostgreSQL diagnostic snapshot.
|
|
pub use self::store::PostgresBackendDiagnostics;
|
|
/// Minimal PostgreSQL store handle.
|
|
pub use self::store::PostgresStore;
|
|
/// PostgreSQL store connection options.
|
|
pub use self::store::PostgresStoreOptions;
|
|
/// PostgreSQL table diagnostic snapshot.
|
|
pub use self::store::PostgresTableDiagnostics;
|
|
/// PostgreSQL table statistics snapshot.
|
|
pub use self::store::PostgresTableStatistics;
|
|
/// Returns a DSN masked for logs and UI diagnostics.
|
|
pub use self::store::mask_postgres_dsn;
|