Relational databases
Relational databases in the Carbium Library: 14 working Solana examples, among them Postgres finalized promotion flag and SQLite discriminator lookup.
- Postgres finalized promotion flag I0165
Log a confirmed transaction's program logs as they land, then set an is_final flag on its row once getSignatureStatuses reports finalized.
- SQLite discriminator lookup I0163
Hash each Anchor instruction name into an 8-byte discriminator, index it in SQLite, and match the first 8 bytes of Carbium transaction data.
- Postgres unchanged-update filter I0161
Skip token account notifications whose data did not change: hash each account's bytes and upsert a row only when the hash moves.
- MySQL user balance reconciliation I0159
Check many SOL balances in one Carbium getMultipleAccounts call, and diff each one against the ledger value your MySQL table keeps.
- Postgres missing-signature audit I0077
Check which addresses of one transaction list its signature in getSignaturesForAddress, and store found or missing with a reason class in Postgres.
- Postgres backfill-to-live handoff I0076
Load a program's past and live logs into one Postgres table: open logsSubscribe first, page back with before, and let the signature key drop overlaps.
- MySQL closed-account tombstones I0074
Mark closed token accounts in a MySQL mirror with a tombstone row, found from the closeAccount instruction and confirmed by a null read from Carbium RPC.
- Drizzle program event schema I0073
Store Anchor program events in one table keyed by signature and event index, decoded from Carbium transaction logs by discriminator.
- SQLite recent transaction cache I0072
Answer the last N transactions of an address from a local SQLite table, and refresh it with one getSignaturesForAddress call that uses until.
- Postgres indexer slot checkpoints I0047
Make a self-built Solana indexer resumable: commit a slot checkpoint with each block row in one Postgres transaction, so a crash leaves no gap and no duplicate.
- SQLite PDA seed registry I0023
Derive PDAs from seeds, keep the seeds in SQLite, and read the accounts from Carbium RPC in batches of 100, with a seed check on every row.
- Postgres token balance watcher I0022
Poll many Postgres-listed token accounts in batches of 100 through Carbium RPC and print upserts, so each balance change reaches a table and a NOTIFY.
- Postgres instruction primary keys I0021
Key each Solana instruction in Postgres by signature, instruction index and inner index, read from Carbium RPC with a script that prints idempotent inserts.
- Postgres deposit matching I0008
Read new finalized deposits to one account from Carbium RPC and print idempotent Postgres inserts, so each payment matches one order exactly once.