Skip to content

mssql provider #5849

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

Merged
merged 39 commits into from
Jul 16, 2025
Merged

mssql provider #5849

merged 39 commits into from
Jul 16, 2025

Conversation

bala-intron
Copy link
Contributor

Add MSSQL Memory Provider to Mastra

Changes

  • Added a new MSSQL memory provider under stores/mssql
  • Implemented MSSQL storage logic and associated tests
  • Updated documentation with MSSQL setup and usage instructions

Why

This enables Mastra to use Microsoft SQL Server (MSSQL) as a backend for memory storage, offering users greater flexibility in database choices.

Copy link

codesandbox bot commented Jul 11, 2025

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented Jul 11, 2025

🦋 Changeset detected

Latest commit: 4525de5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@mastra/mssql Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Jul 11, 2025

@bala-intron is attempting to deploy a commit to the Mastra Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Added MSSQL storage provider to Mastra, enabling Microsoft SQL Server as a backend option for memory storage and thread management.

  • stores/mssql/src/storage/index.ts implements proper MSSQL-specific SQL syntax (square brackets, OFFSET/FETCH) and transaction handling
  • stores/mssql/docker-compose.yaml and docker-compose.perf.yaml need security improvements and performance optimizations compared to PostgreSQL setup
  • Inconsistent version numbering (0.1.0) in stores/mssql/package.json deviates from organization's standard 0.2.0
  • .gitignore and test configurations properly separate unit and performance tests, following project standards
  • CHANGELOG.md lacks proper versioning format and detailed documentation compared to other providers

13 files reviewed, 7 comments
Edit PR Review Bot Settings | Greptile

@bala-intron bala-intron marked this pull request as draft July 11, 2025 14:26
@bala-intron bala-intron marked this pull request as ready for review July 11, 2025 16:43
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Implementation of MSSQL memory provider continues with test suite and storage logic improvements.

  • Test suite in stores/mssql/src/storage/index.test.ts provides thorough validation of CRUD operations, schema isolation, and transaction rollbacks
  • Missing crucial memory optimization settings in docker-compose.perf.yaml for performance testing compared to PostgreSQL setup
  • Performance test configuration in vitest.perf.config.ts needs additional settings for thorough perf testing
  • Typescript configuration in tsconfig.json has overly restrictive test file exclusion that could miss performance tests

13 files reviewed, 3 comments
Edit PR Review Bot Settings | Greptile

@bala-intron
Copy link
Contributor Author

@TheIsrael1 @NikAiyer Please review this. Thanks

@bala-intron
Copy link
Contributor Author

@abhiaiyer91 Can you please approve the workflow run again? I have made changes to pnpm-lock file

@bala-intron
Copy link
Contributor Author

@abhiaiyer91 Fixed the issue with docker health check which made the connection socket hang up issue. Can you please approve the workflow runs again? Thanks

@bala-intron bala-intron requested a review from abhiaiyer91 July 15, 2025 18:34
@bala-intron
Copy link
Contributor Author

@abhiaiyer91 fixed the lint issues. Can you please approve?

Copy link
Collaborator

@NikAiyer NikAiyer left a comment

Choose a reason for hiding this comment

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

Thanks for this PR! Can you also add some docs for this? The reference docs for storage adapters are located here: https://github.com/mastra-ai/mastra/tree/main/docs/src/content/en/reference/storage

@bala-intron
Copy link
Contributor Author

bala-intron commented Jul 15, 2025

@abhiaiyer91 @NikAiyer Removed perf tests and added doc. Please approve

@bala-intron bala-intron requested a review from NikAiyer July 15, 2025 20:52
@abhiaiyer91 abhiaiyer91 merged commit 03745fa into mastra-ai:main Jul 16, 2025
34 of 42 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.

3 participants