node-orm2
node-orm2 copied to clipboard
Add support for MSSQL
This looks like the best ORM I can find. For MSSQL there is none useful. I use MSSQL with tedious (and https://npmjs.org/package/mssql that wraps tedious for easier api)
How would I go about to add support for MSSQL to node-orm2? Because this orm already supports so many databases. I imagine I could hook in MSSQL in a similar way as the others have been hooked in.
You would need to add a file in each of these folders:
https://github.com/dresende/node-orm2/tree/master/lib/Drivers/DML
https://github.com/dresende/node-sql-ddl-sync/tree/master/lib/Dialects
https://github.com/dresende/node-sql-query/tree/master/lib/Dialects
It looks pretty scary, but you just need to copy & paste the file which is most similar to what you need for MSSQL, and modify as required.
I've been thinking about moving all this stuff into one 'driver' package'. rather than having it strewn across three packages.
Hi,
This is something I'm really interested in also. I've started trying to implement this myself using dxg's guidance. I think I've got the DML and DDL correct, but I'm struggling to implement the connection methods (including pooling), using the 'tedious' and 'tedious-connection-pooling' modules for SQL Server support.
Did you manage to make any progress on this, devotis?
Regards, Chris
I don't use tedious directly. I use https://github.com/patriksimek/node-mssql to wrap tedious for a mucher easier api and pooling included.
I didn't make any progress in this particular issue to add support for mssql to orm2...
:+1: Is there any progress with this issue?
Yes there is actually. I forked node-sql-query and there I created this file https://github.com/devotis/node-sql-query/blob/master/lib/Dialects/mssql.js
It's 1 out of 3 thing need to be done according to @dxg . Besided writing tests and doing the pull request. I have no time to bring it further all the way into orm2 for the next few weeks.
Hello! Any progress on this after this post? I'm looking at continuing your implementation.
Let me update my fork and do a PR tomorrow.
Great, thanks!
@thomasdashney, I shouldn't reply with a phone. My fork only has 1 out of 3 files done. According to @dxg we need to add a file in each of these folders (mssql.js)
- https://github.com/dresende/node-orm2/tree/master/lib/Drivers/DML
- https://github.com/dresende/node-sql-ddl-sync/tree/master/lib/Dialects
- https://github.com/dresende/node-sql-query/tree/master/lib/Dialects
I have only done the third. You can find it here: https://github.com/devotis/node-sql-query/blob/master/lib/Dialects/mssql.js. I'll do a PR for that one today, but I'm not going to have time to do other 2.
@thomasdashney @Hyzhak @displaced . The PR is waiting to be pulled. https://github.com/dresende/node-sql-query/pull/35
@devotis thanks. It's merged!
Is MSSQL is supported?
Not yet.
@dxg Can you give me some guides. I want to follow up to make my orm2 to support mssql
There is info above about what needs to be done.
@devotis Is your local orm2 support mssql now?
I never started to actually use node-orm2 as a dependency. So I don't have anything local that isn't already merged here that adds support for mssql. I use https://github.com/dresende/node-sql-query or http://loopback.io/ in my projects.
Is there any progress with this issue? Hope it can support mssql
Nope. I have no interest in adding MSSQL support myself, and until someone opens the required pull requests with tests, MSSQL will not be supported.