Files
sim/packages/db/migrations/0119_far_lethal_legion.sql
Vikhyath Mondreti aea32d423f feat(rate-limiter): token bucket algorithm (#2270)
* fix(ratelimit): make deployed chat rate limited

* improvement(rate-limiter): use token bucket algo

* update docs

* fix

* fix type

* fix db rate limiter

* address greptile comments
2025-12-09 14:57:17 -08:00

8 lines
248 B
SQL

CREATE TABLE "rate_limit_bucket" (
"key" text PRIMARY KEY NOT NULL,
"tokens" numeric NOT NULL,
"last_refill_at" timestamp NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
DROP TABLE "user_rate_limits" CASCADE;