rate_limit_config
Overview
The rate_limit_config table defines the rate limiting rules for each action type. Each row specifies how many actions are allowed within a given time window. Different account tiers can have different limits via the tier_overrides JSONB field.
Schema
-- From 20260205_rate_limiting_fixed.sql
CREATE TABLE rate_limit_config (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
action_type TEXT UNIQUE NOT NULL,
max_actions INTEGER NOT NULL,
window_seconds INTEGER NOT NULL,
tier_overrides JSONB DEFAULT '{}',
description TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | gen_random_uuid() | Primary key |
action_type | text | No | -- | Action identifier (unique) |
max_actions | integer | No | -- | Maximum actions per window |
window_seconds | integer | No | -- | Window duration in seconds |
tier_overrides | jsonb | No | '{}' | Per-tier limit overrides |
description | text | Yes | -- | Human-readable description |
created_at | timestamptz | No | NOW() | Configuration creation timestamp |
RLS Policies
-- SELECT: All authenticated users can read config (needed for client-side display)
CREATE POLICY "Rate limit config is readable"
ON rate_limit_config FOR SELECT
USING (true);
Related
- rate_limits -- Per-user rate tracking using this config
Last updated: 2026-02-07