zen: rate limiter

This commit is contained in:
Frank
2026-04-14 20:29:21 -04:00
parent e5afe2009c
commit 44c7c2a371
12 changed files with 7757 additions and 23 deletions
@@ -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] })],
)