Crate hopr_db_sql

Crate hopr_db_sql 

Source
Expand description

Crate for accessing database(s) of a HOPR node.

Functionality defined here is meant to be used mostly by other higher-level crates. The crate provides database operations across multiple SQLite databases for scalability and supports importing logs database snapshots for fast synchronization.

Re-exports§

pub use db::HoprIndexerDb;
pub use db::HoprIndexerDbConfig;

Modules§

accounts
channels
corrupted_channels
db
errors
info
logs

Structs§

CacheKeyMapper
DatabaseTransaction
Defines a database transaction, whether it is an open transaction and the type of backend to use
OpenTransaction
Represents an already opened transaction. This is a thin wrapper over DatabaseTransaction. The wrapping behavior is needed to allow transaction agnostic functionalities of the DB traits.

Enums§

DatabaseConnection
Handle a database connection depending on the backend enabled by the feature flags. This creates a database pool. This will be Clone unless the feature flag mock is enabled.
TargetDb
When Sqlite is used as a backend, model needs to be split into 4 different databases to avoid locking the database. On Postgres backend, these should actually point to the same database.

Constants§

SINGULAR_TABLE_FIXED_ID
Primary key used in tables that contain only a single row.

Traits§

HoprDbGeneralModelOperations

Type Aliases§

DbTimestamp
Shorthand for the chrono based timestamp type used in the database.
OptTx
Shorthand for optional transaction. Useful for transaction nesting (see HoprDbGeneralModelOperations::nest_transaction).