-
-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add mssql support #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… remove it after all migrations for the specific table are done
cfc33a6 to
dbf182e
Compare
There was a problem hiding this comment.
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 adds MSSQL database support to the extension, enabling database migration operations for both Windows Authentication and username/password authentication on SQL Server databases. The implementation includes a new provider architecture for database abstraction and specific handling for MSSQL-specific features like IDENTITY_INSERT.
Key changes include:
- Implementation of database provider pattern with PostgreSQL and MSSQL providers
- Added MSSQL-specific query generation with proper identifier escaping and value handling
- Enhanced migration logic with IDENTITY_INSERT handling and boolean literal normalization for MSSQL
Reviewed Changes
Copilot reviewed 19 out of 22 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/utils.ts | Updated type definitions and database info generation to support multiple database types |
| src/utils/types.ts | Added common query result interface for database abstraction |
| src/utils/query.ts | Enhanced query builders with database-specific SQL generation and identifier escaping |
| src/utils/database/*.ts | New database provider architecture with PostgreSQL and MSSQL implementations |
| src/commands/migrateDataAsync.ts | Added MSSQL migration logic with IDENTITY_INSERT handling and boolean normalization |
| src/commands/actions/*.ts | Updated to use new database provider pattern instead of direct PostgreSQL client |
| package.json | Added MSSQL dependencies (mssql, msnodesqlv8, @types/mssql) |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
I'm interested in using this, but when I try to build the PR it fails. I've never built a vs code extension before, but it complains about the sqlserver.node file. |
|
@BryanAldrich yes you are right I did only test it via the build in debugger in VSCode. I have now added the correct configuration to build the extension for native clients. But since mssql package cannot run in a webworker this extension can only be build for native VSCode clients now. 🥲 |
|
(for those interested). It isn't working, none of the UI buttons work and throw errors. |
|
Error running command data-sync.import-analyze-data: command 'data-sync.import-analyze-data' not found. This is likely caused by the extension that contributes data-sync.import-analyze-data. |
Hi 👋,
Thanks a lot for this great extension! I really like the concept and the idea of using diffs via VS Code. I've added support for MSSQL databases. I've already tested it in production and haven't found any major issues. Since I needed to authenticate via both Windows Auth and username/password, I also had to implement the msnode sqlv8 driver in addition to mssql.
It's working for now, but I haven't fully battle-tested it yet 🙈.
Feel free to add any suggestions!