PostgreSQL consumers
Flow currently exposes specialized PostgreSQL consumers, not a generic postgres consumer. Pick the consumer that matches the processor output type.
Available PostgreSQL consumers
| Consumer ID | Use with processor IDs | Description |
|---|---|---|
account_data_postgres | account_data | Store Stellar account data in a specialized PostgreSQL schema |
contract_invocations_postgres | contract_invocation, contract_filter | Store Soroban contract invocations in a specialized PostgreSQL schema |
contract_events_postgres | contract_event, contract_filter | Store Soroban contract events in a specialized PostgreSQL schema |
soroswap_postgres | soroswap | Store SwapService events in a specialized PostgreSQL schema |
contract_data_postgres | contract_data | Save contract data to PostgreSQL with configurable schema |
extracted_contract_invocations_postgres | contract_invocation, contract_filter, extracted_contract_invocation | Save extracted contract invocation business data to PostgreSQL with optimized schema |
event_payment_postgres | event_payment_extractor | Saves event payment data to PostgreSQL with accounts tracking |
Connection-field based consumers
Most specialized PostgreSQL consumers use separate connection fields:
consumers:
- type: contract_events_postgres
config:
host: postgres.example.com
port: 5432
database: defaultdb
username: postgres
password: ${POSTGRES_PASSWORD}
sslmode: require
max_open_conns: 10
max_idle_conns: 5
These consumers use that shape:
account_data_postgrescontract_invocations_postgrescontract_events_postgressoroswap_postgresextracted_contract_invocations_postgres
Connection-string consumers
Some consumers use a single connection string instead:
consumers:
- type: contract_data_postgres
config:
database_url: postgres://user:${POSTGRES_PASSWORD}@postgres.example.com:5432/defaultdb?sslmode=require
table_name: contract_data
Connection-string consumers:
contract_data_postgresusesdatabase_urlevent_payment_postgresusesconnectionString
For the complete field list, see Consumers Reference.
