Skip to content

feat: add support for mssql#277

Merged
RambokDev merged 2 commits into
mainfrom
feat/add-mssql-support
May 11, 2026
Merged

feat: add support for mssql#277
RambokDev merged 2 commits into
mainfrom
feat/add-mssql-support

Conversation

@RambokDev

@RambokDev RambokDev commented May 11, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features
    • Added support for Microsoft SQL Server (MSSQL) as a selectable DBMS.
    • Recognizes MSSQL backup files (adds .bacpac handling) for import/export operations.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR adds mssql as a dbms value: updates the exported Postgres enum, adds a SQL migration to extend public.dbms_status, records the migration snapshot and journal entry, and updates file-header mapping for mssql.

Changes

MSSQL Database Support

Layer / File(s) Summary
Schema Type Definition
src/db/schema/types.ts
Exported dbmsEnum Postgres enum definition adds "mssql" to the allowed dbms_status values.
Database Migration
src/db/migrations/0054_hesitant_darkhawk.sql
Migration adds 'mssql' value to the public.dbms_status enum type.
Migration Snapshot & Journal
src/db/migrations/meta/0054_snapshot.json, src/db/migrations/meta/_journal.json
Adds full snapshot JSON for migration 0054 (schema identifiers, tables, enums, scaffolding) and appends a journal entry for the migration (idx 54, version 7, timestamp, breakpoints).
Utility Mapping
src/utils/common.ts
getFileHeadersBasedOnDbms gains a "mssql" case returning MIME application/octet-stream mapped to [".bacpac"].

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly Related PRs

  • Portabase/portabase#242: Both PRs modify the public.dbms_status enum and update src/db/schema/types.ts to add a new DBMS value.
  • Portabase/portabase#234: Both PRs extend dbms_status enum and include migration/schema updates for adding a DBMS value.

Poem

🐰 I added a value, small and spry,
The enum stretched to touch the sky,
A migration stamped, snapshot in tow,
.bacpac files ready to flow,
Hooray for MSSQL — hop, hop, go!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add support for mssql' directly and clearly summarizes the main change: adding MSSQL support throughout the codebase via database migrations, schema types, and utility functions.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/add-mssql-support

Warning

Review ran into problems

🔥 Problems

Timed out fetching pipeline failures after 30000ms

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/db/schema/types.ts`:
- Line 5: The enum dbmsEnum now includes "mssql" but the handling functions
getFileExtension() and getFileHeadersBasedOnDbms() lack a case for it, causing
runtime errors; add a branch for "mssql" to both functions (e.g., return an
appropriate file extension like ".sql" in getFileExtension() and an appropriate
MIME/content-type header like "application/sql" or "text/plain" plus any needed
charset in getFileHeadersBasedOnDbms()), ensuring the symbol "mssql" is handled
the same way across both helpers; alternatively, if MSSQL is not supported,
remove "mssql" from dbmsEnum to keep the enum and handlers consistent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c9d20031-ecde-4baa-9e6d-f4b0e2bc47e7

📥 Commits

Reviewing files that changed from the base of the PR and between d9ccb38 and d04e2d4.

⛔ Files ignored due to path filters (1)
  • public/images/mssql.png is excluded by !**/*.png
📒 Files selected for processing (4)
  • src/db/migrations/0054_hesitant_darkhawk.sql
  • src/db/migrations/meta/0054_snapshot.json
  • src/db/migrations/meta/_journal.json
  • src/db/schema/types.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-test
🔇 Additional comments (3)
src/db/migrations/meta/_journal.json (1)

383-389: LGTM!

The migration journal entry is correctly formatted and consistent with previous entries. The index increments properly from 53 to 54, and all required fields are present.

src/db/migrations/meta/0054_snapshot.json (1)

2618-2631: LGTM!

The schema snapshot correctly includes "mssql" in the dbms_status enum values (line 2630) and provides a complete state capture for migration 0054. The snapshot is properly structured and consistent with the migration changes.

src/db/migrations/0054_hesitant_darkhawk.sql (1)

1-1: ⚡ Quick win

This migration is safe as written; no changes required.

PostgreSQL's ALTER TYPE ... ADD VALUE constraint only blocks adding a new value and then using that value within the same transaction. This migration only adds 'mssql' to the enum without immediately referencing it, so no transaction issue occurs. Drizzle's node-postgres migrator handles this pattern correctly.

Comment thread src/db/schema/types.ts

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/utils/common.ts`:
- Around line 81-84: The MIME mapping added for case "mssql" returns ".bacpac"
but getFileExtension still lacks a "mssql" branch and falls back to ".dump";
update getFileExtension to handle the "mssql" engine explicitly (same codepath
or mapping as the MIME case) so it returns ".bacpac" for "mssql" inputs, keeping
file-extension resolution consistent between the MIME map and getFileExtension.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0f679088-6751-4432-a1a0-c62e06201285

📥 Commits

Reviewing files that changed from the base of the PR and between d04e2d4 and 28afdb1.

📒 Files selected for processing (1)
  • src/utils/common.ts
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build-and-test

Comment thread src/utils/common.ts
@RambokDev RambokDev merged commit 1eb5fbb into main May 11, 2026
5 checks passed
@RambokDev RambokDev deleted the feat/add-mssql-support branch May 11, 2026 20:08
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