Skip to content
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

Mssql support #771

Closed
rubiin opened this issue Aug 24, 2020 · 22 comments · Fixed by #1375
Closed

Mssql support #771

rubiin opened this issue Aug 24, 2020 · 22 comments · Fixed by #1375
Labels
enhancement New feature or request

Comments

@rubiin
Copy link
Contributor

rubiin commented Aug 24, 2020

I think the orm should include mssql as a supported database type by default instead of doing a custom database setup

@rubiin rubiin added the enhancement New feature or request label Aug 24, 2020
@B4nan
Copy link
Member

B4nan commented Aug 25, 2020

there is some WIP here:

https://github.com/UTGuy/mikro-orm-mssql

Going forward I'd like to support it natively, although not a priority.

@rubiin
Copy link
Contributor Author

rubiin commented Aug 25, 2020

there is some WIP here:

https://github.com/UTGuy/mikro-orm-mssql

Going forward I'd like to support it natively, although not a priority.

I am actually starting out a new project in about two weeks later which is on mssql and wanted to use mikroorm instead of sequelize but I am not only the sole developer in the project so we are looking for sequelize alternative which supports mssql out of the box

@B4nan
Copy link
Member

B4nan commented Aug 25, 2020

Will try to spend few hours to check how much is actually done and what is the needed effort to support it.

@rubiin
Copy link
Contributor Author

rubiin commented Oct 13, 2020

@B4nan any updates

@B4nan
Copy link
Member

B4nan commented Oct 13, 2020

@B4nan
Copy link
Member

B4nan commented Nov 1, 2020

I must say SQL server has very weird limitations. First I hit the issue with composite FKs that are sometimes impossible to create in a lazy manner due to SQL server trying to be too smart/strict (it does not allow setting cascading). Now I see Cannot insert explicit value for identity column in table 'book_tag2' when IDENTITY_INSERT is set to OFF. 🤷

Why are people using this? :P Seriously, go with postgres people :P

Anyway, I have around 2/3 tests passing, disabled FKs in the schema generator for now, I know what to do to make it work (and it will also allow having FKs in sqlite at least for creating new tables). So still not there, still few days/weeks ahead of me.

@rubiin
Copy link
Contributor Author

rubiin commented Nov 1, 2020

yes, Sql server is too smartass .I came up with those problems when i migrated from pg to mssql

@svantreeck
Copy link

svantreeck commented Dec 9, 2021

Is this is still in progress? Originally I think it was listed as an issue worth exploring in v5 (#1623), but its not listed there anymore. If there are any blockers, how could someone help? Thanks!

@Langstra
Copy link
Collaborator

I believe B4nan worked on it in this MR #1375 guess you could have a look at it if you're interested?

@B4nan
Copy link
Member

B4nan commented Dec 11, 2021

There is no progress, I don't consider this as something important, I gave it a try several times, but as for someone who never used mssql, the way that driver behaves is too much out of space to understand it. The blocker is schema generation and diffing, namely complex composite PKs and FK constraints, as that works differently than the rest of SQL drivers.

As said, there is a WIP PR, feel free to give it a try yourself if it is important to you.

If there would be some company willing to sponsor the driver development, that would be a different story.

@UTGuy
Copy link
Contributor

UTGuy commented Mar 29, 2022

I just recently updated those drivers. While schema generation is out of the question the driver does function perfectly fine. I also added a Unicode type to handle nvarchar columns.

@sauravyadav1958
Copy link

I cannot use Micro ORM because it does not support MS SQL

@Outternet
Copy link

I have opened a bug bounty for this issue https://app.bountysource.com/issues/92424462-mssql-support if that is okay with you @B4nan. @sauravyadav1958 if you can't donate with your time and it's that important for you, you might consider adding to the bounty to help the creator or @UTGuy make an implementation.

@B4nan
Copy link
Member

B4nan commented Jul 29, 2022

FYI we are quite close to bringing this live. Last missing piece of puzzle is the schema diffing .

With that said, it took a lot of time already for me as well as @UTGuy, so being close does not mean it will happen soon :]

Intereting idea with the bug bounty, it can definitely change the order of priorities. For me this was kind of a black hole for my spare time, so I usually favour issues I can deal with within hours and not weeks :D I think it would be fair to divide that somehow between me and @UTGuy once we finilize this.

@Outternet
Copy link

I don't mind donating to an almost-finished feature, I love the stability of Mikro-Orm (switched from TypeOrm) and unit-of-work of course. Bug bounties are meant to show interest in certain features (and it might alter the priority, which would be a plus for me personally :D). You can do a joint claim with @UTGuy I think, otherwise, the claimer needs to distributor it manually. Feel free to prioritize how you see fit, I am just placing it to show my support.

@justinhenricks
Copy link

About to start a rather large project that relies on a SQL Server DB.. would love to use Mikro ORM, is this driver still a ways out from being pulled in?

@SteadEXE
Copy link
Contributor

Any news about this?

@rubiin
Copy link
Contributor Author

rubiin commented Sep 18, 2023

most other orms use tedious package to work with mssql maybe that would help

@ruscon
Copy link
Contributor

ruscon commented Nov 15, 2023

Will be good to incapsulate tedious into mikro-orm-mssql driver. Is it possible?

@lroal

This comment was marked as spam.

@B4nan
Copy link
Member

B4nan commented Apr 3, 2024

After many obstacles, #1375 is near the finish line and will be part of v6.2.

@ruscon
Copy link
Contributor

ruscon commented Apr 3, 2024

@B4nan Great news, thanks. We are looking forward to testing it.

B4nan added a commit that referenced this issue Apr 5, 2024
Adds a new `@mikro-orm/mssql` package.

Closes #771

---------

Co-authored-by: Michael Walters <mikel.walters@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.