Crate essential_builder_db

Source
Expand description

The database API for the block builder’s solution set pool and related storage.

The essential-builder-db crate provides a simple database API for managing the block builder’s solution set pool and related storage, using SQLite as the underlying database. It allows you to store, query, and delete solution sets, as well as manage solution set submissions with timestamps.

§Overview

Re-exports§

pub use pool::ConnectionPool;

Modules§

error
pool
Provides an async-friendly ConnectionPool implementation.
sql
Provides the SQL statements used by essential-builder-db via const strs.

Functions§

create_tables
Create all tables.
decode
Decodes the given blob into a value of type T.
delete_oldest_solution_set_failures
Delete the oldest solution set failures until the number of stored failures is less than or equal to keep_limit.
delete_solution_set
Delete the solution set with the given CA from the database if it exists.
delete_solution_sets
Delete the solution sets with the given CAs from the database if they exist.
encode
Encodes the given value into a blob.
get_solution_set
Fetches a solution set by its content address.
insert_solution_set_failure
Record a failure to include a solution set in a block.
insert_solution_set_submission
Insert a submitted solution set and the time it was received into the table.
latest_solution_set_failures
Query the latest solution set failures for a given solution set content address.
list_solution_set_failures
List the latest solution set failures.
list_solution_sets
List all solution sets that were submitted within the given time range.
list_submissions
List all submissions that were made within the given time range.
with_tx
Short-hand for constructing a transaction, providing it as an argument to the given function, then committing the transaction before returning.