zen: rate limiter

This commit is contained in:
Frank 2026-04-14 20:29:21 -04:00
parent 2c36bf9490
commit 8df7ccc304
12 changed files with 7757 additions and 23 deletions

View file

@ -20,3 +20,13 @@ export const IpRateLimitTable = mysqlTable(
},
(table) => [primaryKey({ columns: [table.ip, table.interval] })],
)
export const KeyRateLimitTable = mysqlTable(
"key_rate_limit",
{
key: varchar("key", { length: 255 }).notNull(),
interval: varchar("interval", { length: 40 }).notNull(),
count: int("count").notNull(),
},
(table) => [primaryKey({ columns: [table.key, table.interval] })],
)