feat: add support for mssql#277
Conversation
📝 WalkthroughWalkthroughThis PR adds ChangesMSSQL Database Support
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly Related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed 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.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
public/images/mssql.pngis excluded by!**/*.png
📒 Files selected for processing (4)
src/db/migrations/0054_hesitant_darkhawk.sqlsrc/db/migrations/meta/0054_snapshot.jsonsrc/db/migrations/meta/_journal.jsonsrc/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_statusenum 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 winThis migration is safe as written; no changes required.
PostgreSQL's
ALTER TYPE ... ADD VALUEconstraint 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.
There was a problem hiding this comment.
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
📒 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
Summary by CodeRabbit