feat: Phase 10 - Database Provider Adapter Layer#15
Conversation
- Add provider adapters for Neon, Turso, PlanetScale, Supabase, Postgres - Implement ProviderAdapter interface with connect(), getMigrationsDriver(), supportsRLS(), supportsGraphQL() - Add CLI integration with provider prompts for database selection - Add Drizzle config generation for each provider type - Add provider-specific Zod schemas for configuration validation - Add helper functions: providerSupportsRLS(), getProviderDialect() - Fix missing @neondatabase/serverless dependency for Neon provider - Add explicit driver 'pg' for Supabase Drizzle config
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughThis pull request introduces a comprehensive blueprint for BetterBase v3 Phases 10–15 and implements foundational infrastructure for provider-agnostic database adapters. It refactors the CLI initialization flow with modular provider prompts, adds adapter implementations for Neon, Turso, PlanetScale, Supabase, and PostgreSQL, and establishes configuration generation helpers for Drizzle and environment setup. The core configuration schema is extended to support optional storage, webhooks, and GraphQL sections. Changes
Sequence DiagramsequenceDiagram
participant User as User
participant CLI as CLI Init
participant ProviderPrompt as Provider Prompt
participant ConfigGen as Config Generator
participant Provider as Provider Adapter
User->>CLI: Run init command
CLI->>ProviderPrompt: promptForProvider()
ProviderPrompt->>ProviderPrompt: Display provider options
User->>ProviderPrompt: Select provider (e.g., Neon)
ProviderPrompt->>ProviderPrompt: Prompt for credentials
User->>ProviderPrompt: Enter DATABASE_URL
ProviderPrompt-->>CLI: Return {providerType, envVars}
CLI->>ConfigGen: generateDrizzleConfig(providerType)
ConfigGen->>ConfigGen: Map provider → dialect & driver
ConfigGen-->>CLI: Return drizzle.config.ts content
CLI->>ConfigGen: generateEnvContent(providerType, envVars)
ConfigGen-->>CLI: Return .env content
CLI->>Provider: resolveProvider(config)
Provider->>Provider: Validate config schema
Provider-->>CLI: Return NeonProviderAdapter instance
CLI->>User: Scaffolding complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Improvements