Crate essential_builder_db

source
Expand description

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

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

§Overview

Re-exports§

Modules§

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

Functions§

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