Skip to content

@xtandard/entitlements/counters/drizzle

Drizzle counter store over a counter table you own (drizzle/* *CountersTable() factories): atomic upserts on Postgres, MySQL and SQLite (ADR 0004).

import { … } from "@xtandard/entitlements/counters/drizzle";
Name Summary
createDrizzleCounterStore Create a Drizzle-backed counter store.
Name Summary
DrizzleCounterStore A Drizzle CounterStore with keys and an expired-row sweep.
DrizzleCounterStoreOptions Options for createDrizzleCounterStore.
Name Summary
DrizzleCounterTable A table with the fixed columns the Drizzle counter store requires: key (primary key), value (double), applied (double — the amount the last operation on the row applied, returned atomically with the new value) and expiresAt (bigint unix ms, nullable).