Expand description
Unified database handler that owns a connection pool and implements
all persistence traits from hypercall_db.
This is the standalone Diesel persistence layer. It has NO dependency
on the root hypercall crate and owns its own DbPool directly.
All SQL is inline or delegated to local modules (crate::ledger_ops,
crate::settlement_ops, crate::order_status_materialization).
Trait implementations live in sibling modules:
crate::instruments– InstrumentReader / InstrumentWritercrate::tiers– TierReader / TierWritercrate::mmp– MmpConfigReader / MmpConfigWritercrate::orders– OrderReader / OrderWriter + fill ledger helpercrate::transaction– Transactional (+ DieselTransaction)crate::replay– JournalReplayReadercrate::rfq– RfqReader / RfqWritercrate::settlements– SettlementReader / SettlementWriter
Structs§
- Database
Handler - Synchronous persistence handler. Owns an r2d2 connection pool and
implements all engine-path traits from
hypercall_db(orders, instruments, tiers, settlements, journal replay, archiver, RFQ). - DynConnection
Manager - Connection manager that resolves the database URL on every
connect()call. - Hypercall
Migrations 🔒 - Diesel runs each embedded migration file with one
batch_executecall. PostgreSQL rejectsCREATE/DROP INDEX CONCURRENTLYwhen it appears in a multi-statement batch, even outside an explicit transaction. This source replaces the one affected migration with a splitter that executes each statement separately while preserving Diesel’s migration ledger behavior. - NonTransactional
Migration 🔒Metadata - PgTimeout
Customizer 🔒 - Sets statement_timeout and lock_timeout on every new Postgres connection.
- Split
Statement 🔒Migration - Static
Migration 🔒Name
Constants§
- MIGRATIONS
- Embed migrations relative to hypercall-rs/db-diesel/Cargo.toml.
- ORDER_
INFOS_ 🔒ACTIVE_ SYMBOL_ INDEX_ MIGRATION
Functions§
- build_
db_ pool - Build a raw r2d2 pool with the given auth config, for callers that manage
the pool lifecycle themselves (e.g.
integrated.rs). - current_
option_ 🔒token_ deployment - Read the option token deployment parameters from environment variables.
Used by
save_market_and_instrument_syncto derive option token addresses. - redact_
database_ 🔒url - Redact credentials from a database URL for safe logging.
- rsm_
deposit_ 🔒match_ from_ row - wallet_
from_ 🔒bytes
Type Aliases§
- DbPool
- Synchronous r2d2 connection pool for Postgres.
- Legacy
DbPool - Legacy pool type alias for backward compatibility with code that constructs
pools directly with
ConnectionManager.