Skip to content

feat: add RequestShaper database schema#113

Open
TheArchitectit wants to merge 1 commit intomcowger:mainfrom
TheArchitectit:feat/shaper-schema
Open

feat: add RequestShaper database schema#113
TheArchitectit wants to merge 1 commit intomcowger:mainfrom
TheArchitectit:feat/shaper-schema

Conversation

@TheArchitectit
Copy link
Contributor

Part 3: Database Schema (53 lines)

Add database schema for RequestShaper service.

Size: 53 lines ✅

@TheArchitectit
Copy link
Contributor Author

Code Overview

This PR adds database schema for RequestShaper persistence.

Key Changes:

  1. packages/backend/drizzle/schema/sqlite/provider-rate-limits.ts - SQLite schema
  2. packages/backend/drizzle/schema/postgres/provider-rate-limits.ts - PostgreSQL schema
  3. packages/backend/drizzle/migrations/0016_hard_vulcan.sql - Migration file
  4. packages/backend/drizzle/schema/index.ts - Export updates

Schema:

  • provider_rate_limits table
  • Fields: provider, model, alias, current_budget, last_refill_at
  • Indexes for lookup performance

Migration:

  • Run: npm run db:migrate
  • Backward compatible (new table, no breaking changes)

Testing:

  • Migration applies cleanly to both SQLite and PostgreSQL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant