Skip to content

feat: enhance migration handling and update documentation for bridge architecture#75

Merged
Yashh56 merged 17 commits into
Relwave:developfrom
Yashh56:feat/ai-int
Jun 14, 2026
Merged

feat: enhance migration handling and update documentation for bridge architecture#75
Yashh56 merged 17 commits into
Relwave:developfrom
Yashh56:feat/ai-int

Conversation

@Yashh56

@Yashh56 Yashh56 commented Jun 13, 2026

Copy link
Copy Markdown
Member

This pull request introduces several improvements and updates across the AI features, database connector architecture, and dependency management for the bridge package. The most significant changes include a new AI features section in the documentation, enhanced schema analysis prompt formatting, increased AI model output limits, improved baseline migration handling for MySQL/MariaDB connectors, and an upgrade of the uuid package.

AI Features and Prompt Improvements

  • Added a comprehensive "AI Features and Providers" section to FEATURES.md, documenting supported LLM providers, AI capabilities, and privacy options.
  • Refactored the schema analysis prompt in schema-analysis.ts for denser, more token-efficient output, improving downstream AI analysis quality.
  • Increased output token limits for all AI providers (OpenAI, Anthropic, Mistral, Groq, Gemini, Ollama) to 4096 tokens for richer, less truncated responses. [1] [2] [3] [4] [5] [6]

Database Connector Architecture and Migration Handling

  • Added a new README.md in src/connectors describing the connector layout, extension points, and best practices for bridge database integration.
  • Refactored MySQL and MariaDB connectors to:
    • Use the projectStoreInstance for migration directory resolution and schema snapshot retrieval.
    • Pass actual schema snapshots to baseline migrations, ensuring baseline files contain real DDL. [1] [2] [3] [4] [5] [6] [7]
    • Fix type handling for backend process IDs and improve column metadata extraction. [1] [2] [3] [4]

Dependency and Build Updates

  • Upgraded uuid to version 14 and added @types/uuid to dependencies for improved type safety and compatibility. Updated pnpm-lock.yaml accordingly. [1] [2] [3] [4] [5] [6] [7] [8]
  • Updated CONTRIBUTING.md with instructions for building the bridge package on Windows and Linux.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands RelWave’s migration/import workflow and bridge architecture by adding import analysis + migration sync UI, improving schema snapshot/baseline handling across connectors, and updating AI prompting/provider limits plus documentation.

Changes:

  • Added import analysis + UI flows to prompt users to apply pending migrations or apply a schema snapshot baseline, plus “migration sync” actions in the Git panel.
  • Improved bridge-side schema snapshot/migration support (new schema file v2 shape, migration lock file, connector baseline generation from real snapshots).
  • Increased AI provider output limits and refactored schema-analysis prompt formatting; updated project documentation/READMEs.

Reviewed changes

Copilot reviewed 57 out of 59 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/services/bridge/project.ts Adds frontend bridge service methods for import/migration workflows (incl. SQL generation call).
src/pages/DatabaseDetails.tsx Integrates migration panel navigation and migration sync dialog into DB detail page.
src/lib/utils.ts Adds shared timestamp + relative time formatting helpers.
src/features/schema-explorer/components/SchemaExplorerHeader.tsx Uses selected/first schema as default instead of hardcoded public.
src/features/project/types.ts Adds import analysis + drift typing for new migration sync features.
src/features/project/hooks/useProjectSync.ts Adds import analysis fetch + prevents auto schema overwrite when drift detected.
src/features/project/hooks/useImportAnalysis.ts New hook to fetch import analysis for overview cards.
src/features/project/components/SchemaDriftSheet.tsx New sheet UI to display drift state and refresh schema cache.
src/features/project/components/MigrationSyncDialog.tsx New dialog prompting users to apply migrations or apply a schema snapshot baseline (+ SQL preview).
src/features/home/utils.ts Removes home-scoped relative-time util (moved to shared utils).
src/features/home/components/WelcomeView.tsx Switches to shared formatRelativeTime helper.
src/features/home/components/MigrationStatusCard.tsx New card showing migration/drift status using import analysis.
src/features/home/components/index.ts Stops re-exporting removed home utils.
src/features/home/components/DatabaseOverviewPanel.tsx Adds migration status card when a project exists.
src/features/home/components/DatabaseDetail.tsx Passes projectId into overview panel.
src/features/home/components/ConnectionDetails.tsx Uses shared timestamp formatting for createdAt.
src/features/git/components/GitStatusPanel.tsx Adds migration sync/push actions wired to new project RPC methods.
src/features/database/components/MigrationsPanel.tsx Improves pending count + uses shared timestamp formatting.
src/components/ui/SQLPreviewSheet.tsx New SQL preview sheet for baseline SQL preview.
src/components/ui/skeleton.tsx New Skeleton component for loading states.
src/components/ui/sheet.tsx New Sheet primitive wrapper for drift UI.
src/components/layout/VerticalIconBar.tsx Adds a “Migrations” panel entry to DB navigation.
pnpm-lock.yaml Lockfile updates (platform metadata changes).
FEATURES.md Adds “AI Features and Providers” documentation section.
CONTRIBUTING.md Adds bridge package build instructions + test docker compose step.
bridge/src/utils/README.md Documents bridge utils folder structure/conventions.
bridge/src/utils/migrationFileReader.ts Accepts 13- or 14-digit migration versions in filenames.
bridge/src/utils/config.ts Removes legacy getMigrationsDir (moved to project store resolution).
bridge/src/utils/baselineMigration.ts Generates baseline SQL from real schema snapshots (+ quoting).
bridge/src/types/README.md Documents bridge shared types folder.
bridge/src/types/common.ts Extends column detail shape with unique/serial/check/comment fields.
bridge/src/services/README.md Documents bridge services folder and responsibilities.
bridge/src/services/queryExecutor.ts Maps new column metadata fields into canonical schema shape.
bridge/src/services/projectStore.ts Introduces schema file v2, schema migration, and migration dir resolution/migration.
bridge/src/services/migrationLock.ts Adds migration lock read/write/verify utilities.
bridge/src/services/gitService.ts Adds migration sync orchestration helpers (stage/commit/push).
bridge/src/services/aiHistoryStore.ts Reuses sqlite native binding resolver via direct import.
bridge/src/queries/README.md Documents centralized SQL query module structure.
bridge/src/queries/postgres/tables.ts Adds unique/serial/comment/check constraint fields to column batch query.
bridge/src/queries/mysql/columns.ts Adds unique/serial/comment fields (and placeholder check) to column batch query.
bridge/src/jsonRpcHandler.ts Registers new RPC methods and updates ProjectHandlers constructor args.
bridge/src/handlers/README.md Documents handler architecture and how to add RPC methods.
bridge/src/handlers/projectHandlers.ts Adds import analysis, schema cache refresh, migration sync/push/verify RPC endpoints.
bridge/src/handlers/migrationHandlers.ts Adds apply-all/apply-snapshot endpoints and updates migration dir resolution + git/lock hooks.
bridge/src/connectors/sqlite.ts Uses projectStore migrations dir + passes snapshot into baseline generation; exports native binding resolver.
bridge/src/connectors/README.md Documents connector structure and conventions.
bridge/src/connectors/postgres.ts Uses projectStore migrations dir + passes snapshot into baseline generation; enriches column mapping.
bridge/src/connectors/mysql.ts Uses projectStore migrations dir + passes snapshot into baseline generation; enriches column mapping.
bridge/src/connectors/mariadb.ts Uses projectStore migrations dir + passes snapshot into baseline generation; enriches column mapping.
bridge/src/ai/providers/openai.provider.ts Raises max output tokens.
bridge/src/ai/providers/ollama.provider.ts Raises max output tokens via num_predict.
bridge/src/ai/providers/mistral.provider.ts Raises max output tokens.
bridge/src/ai/providers/groq.provider.ts Raises max output tokens.
bridge/src/ai/providers/gemini.provider.ts Raises max output tokens via generation config.
bridge/src/ai/providers/anthropic.provider.ts Raises max output tokens.
bridge/src/ai/prompts/schema-analysis.ts Refactors schema analysis prompt into denser/token-efficient format.
bridge/pnpm-lock.yaml Updates bridge lockfile for uuid bump.
bridge/package.json Updates uuid dependency version.
bridge/tests/projectStore.test.ts Updates schema snapshot test fixtures for schema v2 fields.
Files not reviewed (2)
  • bridge/pnpm-lock.yaml: Generated file
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/ui/skeleton.tsx
Comment thread bridge/src/handlers/projectHandlers.ts
Comment thread bridge/src/handlers/projectHandlers.ts
Comment thread bridge/src/services/gitService.ts
Comment thread src/services/bridge/project.ts
Comment thread bridge/src/handlers/migrationHandlers.ts Outdated
Comment thread bridge/src/handlers/migrationHandlers.ts Outdated
Comment thread bridge/src/handlers/migrationHandlers.ts Outdated
Comment thread bridge/package.json
@Yashh56 Yashh56 merged commit 390cc55 into Relwave:develop Jun 14, 2026
2 checks passed
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.

2 participants