Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTables ¶
func CreateTables(ctx context.Context, client *dynamodb.Client, messagesTable, pointersTable, reactionsTable, reactorsTable, selfReactionsTable, boostsTable string) error
CreateTables provisions the messages, message_pointers, message_reactions, message_reactors, message_self_reactions and message_reaction_boosts tables. All use a composite (pk, sk) string key with on-demand billing. The reactors table carries the by_version LSI for strongly-consistent, most-recent-first paging of plain reactors and the sparse by_boost GSI for the boosted head (see gsiByBoost); the boosts table one LSI for a history read not built yet; the other four need no secondary index — event-ordered delta reads page the evt# rows, summary reads page the agg# rows, and a viewer's self overlay pages their own partition, each as a sort-key range. The messages table has TTL enabled on attrExpiresAt so the transient cmid# idempotency markers are auto-reaped. It is idempotent: tables that already exist are left as-is, which means a reactors table from before by_boost is not given the index here; it is added to the live table out of band, by the infrastructure terraform (a GSI can be added to a live table, an LSI cannot). Nothing reads the index until some emoji has more than MaxStoredSampleReactors boosters (see gsiByBoost), so the order is: deploy, add the index and wait for it to be active, then let boosts be recorded. The call blocks until all tables are ACTIVE.
Types ¶
This section is empty.