node-orm2 icon indicating copy to clipboard operation
node-orm2 copied to clipboard

Add support for MSSQL

Open christiaanwesterbeek opened this issue 11 years ago • 19 comments

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.

christiaanwesterbeek avatar Jan 03 '14 11:01 christiaanwesterbeek

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.

dxg avatar Jan 06 '14 22:01 dxg

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

displaced avatar Feb 04 '14 16:02 displaced

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...

christiaanwesterbeek avatar Feb 04 '14 16:02 christiaanwesterbeek

:+1: Is there any progress with this issue?

hyzhak avatar May 29 '14 18:05 hyzhak

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.

christiaanwesterbeek avatar May 30 '14 05:05 christiaanwesterbeek

Hello! Any progress on this after this post? I'm looking at continuing your implementation.

thomasdashney avatar Jul 08 '14 19:07 thomasdashney

Let me update my fork and do a PR tomorrow.

christiaanwesterbeek avatar Jul 08 '14 20:07 christiaanwesterbeek

Great, thanks!

thomasdashney avatar Jul 08 '14 20:07 thomasdashney

@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)

  1. https://github.com/dresende/node-orm2/tree/master/lib/Drivers/DML
  2. https://github.com/dresende/node-sql-ddl-sync/tree/master/lib/Dialects
  3. 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.

christiaanwesterbeek avatar Jul 09 '14 07:07 christiaanwesterbeek

@thomasdashney @Hyzhak @displaced . The PR is waiting to be pulled. https://github.com/dresende/node-sql-query/pull/35

christiaanwesterbeek avatar Jul 10 '14 19:07 christiaanwesterbeek

@devotis thanks. It's merged!

dxg avatar Aug 21 '14 10:08 dxg

Is MSSQL is supported?

CreativeManix avatar Jan 28 '16 14:01 CreativeManix

Not yet.

dxg avatar Jan 29 '16 03:01 dxg

@dxg Can you give me some guides. I want to follow up to make my orm2 to support mssql

tcwyjno1 avatar May 13 '16 06:05 tcwyjno1

There is info above about what needs to be done.

dxg avatar May 24 '16 01:05 dxg

@devotis Is your local orm2 support mssql now?

tcwyjno1 avatar May 25 '16 03:05 tcwyjno1

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.

christiaanwesterbeek avatar May 27 '16 05:05 christiaanwesterbeek

Is there any progress with this issue? Hope it can support mssql

tcwyjno1 avatar Jul 05 '16 02:07 tcwyjno1

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.

dxg avatar Jul 05 '16 04:07 dxg