Skip to main content

initialize_ig_options_table

Function initialize_ig_options_table 

Source
pub async fn initialize_ig_options_table(pool: &PgPool) -> Result<(), AppError>
Available on crate feature persistence only.
Expand description

Initializes the ig_options table used by store_transactions.

Ships the DDL in code (like the other storage tables) so persistence works against a fresh database. The raw_hash column is the deduplication key: it stores the MD5 digest of the raw transaction JSON and carries a UNIQUE constraint so re-ingesting an identical payload is a no-op. Call this once before store_transactions.

§Arguments

  • pool - PostgreSQL connection pool

§Errors

Returns AppError if the CREATE TABLE statement fails.