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.

Re-exports§

pub use hopr_db_api as api;

Modules§

accounts
channels
db
errors
info
logs
peers
protocol
registry
resolver
tickets

Structs§

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§

HoprDbAllOperations
Convenience trait that contain all HOPR DB operations crates.
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).