Skip to content

Conversation

nick-w-nick
Copy link
Contributor

πŸ”— Linked issue
resolves #120

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description
In this PR I've implemented an MSSQL connector utilizing the tedious library.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 35.15152% with 107 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@11c2bf2). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/connectors/mssql.ts 35.62% 103 Missing ⚠️
scripts/gen-connectors.ts 0.00% 4 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121   +/-   ##
=======================================
  Coverage        ?   42.87%           
=======================================
  Files           ?       23           
  Lines           ?     1024           
  Branches        ?      106           
=======================================
  Hits            ?      439           
  Misses          ?      581           
  Partials        ?        4           

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

}

if (value instanceof Date) {
return TYPES.DateTime;
Copy link

Choose a reason for hiding this comment

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

There is also a DateTime2 type in tedious and in SQL

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peterbud This code was taken directly from the Kysely library, but upon research I do see that DateTime2 is a more suitable suggestion for anything new going forward. The MSSQL documentation says that it aligns with the existing SQL standard and should be able to be used as a drop-in replacement.

Would you prefer if we use DateTime2 as the default here instead?

Copy link

Choose a reason for hiding this comment

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

I think that would be better. datetime has issues with fractional milliseconds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@peterbud I've pushed up a commit to swap this value to use DateTime2. Let me know if this works for you.

Thanks!

Copy link

Choose a reason for hiding this comment

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

LGTM

@pi0
Copy link
Member

pi0 commented Jan 27, 2025

Hi @nick-w-nick, thanks for your work on this. sorry it might take me longer to be able to properly review and test this PR but I have not forgotten.

@nick-w-nick
Copy link
Contributor Author

@pi0 I've gone ahead and updated the PR to use the new typings/export logic that had been merged in previously. All merge conflicts should be the resolved and the tests should now pass once more.

If you need it to test locally, this is the Docker image I am using for MSSQL as it is the most compatible across platforms:
https://hub.docker.com/r/microsoft/azure-sql-edge

These are the environment variables required (also shown in the .env.example file)

MSSQL_HOST=localhost
MSSQL_PORT=1433
MSSQL_USERNAME=sa # default mssql username
MSSQL_PASSWORD=password
MSSQL_DB_NAME=test_db

Let me know if you need any additional assistance!

@sbruegel
Copy link

Hey guys,

just wondering what the status is on this PR? Is it planned to get this merged as there was no update since 4 month. Know it is still in review, not sure if there is a way to somehow support?
Thanks for the amazing work. Would like to see it in the code base

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.

MSSQL Connector
4 participants