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
feat(mssql): add MS SQL Server driver #1375
Conversation
@B4nan Would love to see more work done on this |
Well, then do the work on this :] For me this have very low priority. I did gave it a try and rebased to latest v5 but it did not really help, there are more blockers than just the schema generator, and for me there are too much unknowns as I never used mssql. |
1357827
to
d749e70
Compare
This pull request introduces 1 alert when merging d749e70 into bb467f7 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 23b2dd8 into bb467f7 - view on LGTM.com new alerts:
|
You asked... I've delivered. |
This pull request introduces 1 alert when merging 6b58377 into 71b77af - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 179ae6f into 71b77af - view on LGTM.com new alerts:
|
1fbe609
to
445dcc2
Compare
This pull request introduces 1 alert when merging 445dcc2 into 71b77af - view on LGTM.com new alerts:
|
7ca6218
to
5cb6cea
Compare
This pull request introduces 2 alerts when merging 5cb6cea into 60ec052 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging b7bb78e into 60ec052 - view on LGTM.com new alerts:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1375 +/- ##
==========================================
+ Coverage 99.70% 99.71% +0.01%
==========================================
Files 238 252 +14
Lines 17248 17754 +506
Branches 4224 4087 -137
==========================================
+ Hits 17197 17704 +507
+ Misses 51 49 -2
- Partials 0 1 +1 ☔ View full report in Codecov by Sentry. |
The edit: ok, much better now, tests went from 30-40s down to ~5s |
All the mapped types you added seems to be not needed, I guess that was for some initial implementation, right? Will remove them, all the tests are passing just fine without them. If they are needed, we need a test case that shows why we need them. Will try to get the schema generator working, for now with disabled FKs, given we can't even define all of them in the edit: looking into datetime, is there any reason not to use datetime2 by default? I will probably do that, as I want to have the |
They are absolutely needed! UnicodeMSSql uses N-types (Unicode types) which is different from regular strings (Non-unicode types). If you have no ability to apply Unicode types then languages like Chinese will fail. This is incredibly important. TimeStampIf the Sql database is not set to UTC then all timestamped Date's will not be correctly stamped to UTC. The TimeStamp type overrides this. MSSql has multiple "Datetime" types it can use... one doesn't append the 'Z' for example and another does. This is important if your coming from a DB that is older and not generated from mikro-orm. |
I guess you are missing my point. Those types should be applied to all strings/dates, right? We dont need them if things work out of box the same way for all strings/dates. If you think they are still needed (with my latest changes), please provide test case that proves it. I already removed them, everything is passing just fine. I dont want to bend internals via custom types - that is an extension for users, internally we can find more performant ways to do things. |
Yes, I will add some tests that will cause the default assumption of Unicode to fail. N'value' You can't just set the database type to I will create a test that will have an |
…rge drop column queries
…ches When you run a batch of queries via `schema.execute()`, they are now grouped based on blank lines - a blank line between groups of statements means they will be executed separately. This is important for some queries that cannot be ran in a single batch, like when you create a database and switch to it.
…efreshDatabase()`
Previously, we only cared about the column type, now we also check if the column is/was a FK or not.
Adds a new
@mikro-orm/mssql
package.Closes #771