Skip to main content

Crate rbp_database

Crate rbp_database 

Source
Expand description

Database pipeline for training artifacts.

Bulk data movement between Rust structures and PostgreSQL, optimized for the large-scale writes required during abstraction and blueprint training.

§Connectivity

  • db() — Establishes a database connection from DB_URL

§Serialization Traits

  • Schema — Table metadata and DDL generation
  • Derive — INSERT statement generation for enumerable types
  • Hydrate — Binary format decoding from rows
  • Row — Binary row serialization for COPY protocol
  • Streamable — Bulk data upload via COPY

§Core Types

  • Stage — Temporary staging table management
  • Check — Schema validation and migration status

§Table Names

Constants for all persistent entities: abstractions, blueprints, metrics, hands, sessions, and more.

Constants§

ABSTRACTION
Table for abstraction bucket definitions.
ACTIONS
Table for game actions (bets, raises, folds, etc.).
BLUEPRINT
Table for MCCFR blueprint strategies (policy + regret).
EPOCH
Table for training epoch metadata and progress.
HANDS
Table for completed poker hands.
ISOMORPHISM
Table for isomorphism → abstraction mappings.
METRIC
Table for pairwise abstraction distances.
PLAYERS
Table for player participation in hands.
ROOMS
Table for active game rooms.
SESSIONS
Table for user authentication sessions.
STAGING
Table for staging data during bulk operations.
STREET
Table for street-specific metadata.
TRANSITIONS
Table for abstraction transition probabilities.
USERS
Table for registered user accounts.

Traits§

Check
Check defines status queries for training orchestration. Consolidates existence/count checks used by Trainer and PreTraining.
Derive
Derived table generation from enumerable domain values.
Hydrate
Loading domain objects from PostgreSQL.
Row
Binary row serialization for PostgreSQL COPY protocol.
Schema
Schema metadata for PostgreSQL tables.
Stage
Stage defines bulk upload operations for fast training. Manages staging table lifecycle and batch epoch updates.
Streamable
Bulk data upload via PostgreSQL’s binary COPY protocol.

Functions§

db
Establishes a database connection.

Type Aliases§

PgErr
PostgreSQL error type alias.