

Introducing the Microsoft Driver for Node.JS for SQL Server - redidas
http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

======
latch
"access from any Node.JS applications"....running on Windows. Pretty big
limitation which suggests it's business as usual at Microsoft.

Also

    
    
      "Driver={SQL Server Native Client 11.0};Server=(local);Database=AdventureWorks2012;Trusted_Connection={Yes}";
    

really should be:

    
    
      {server: 'localhost', database: 'AdventureWorks2012', trusted: true}

~~~
Animus7
For some reason the driver also requires Visual C++ 2010 as well as SQL Server
Native Client 11.0, and includes significant C++ boilerplate which was clearly
pasted verbatim from existing C++ codebases, thus ensuring the driver is
beyond modification and customization for the typical Node dev.

> The Microsoft Driver for Node.JS for SQL Server is hosted on Github,
> accentuating our continued involvement with the Open Source community.

Except, this isn't so much openness as it is an underhanded attempt at
migrating more developers to their proprietary platforms. It certainly makes
business sense for them and I'm not going to make any normative claims, but I
wish they wouldn't beat around the bush. The "Open Source" community that
they're trying to cater to is more bullshit-averse than they seem to realize.

~~~
daeken
> Except, this isn't so much openness as it is an underhanded attempt at
> migrating more developers to their proprietary platforms.

Shame on them. They shouldn't be contributing software at all if it won't work
on every platform. For all they know, I might want to connect to SQL Server
from Node.JS running on my Commodore 64, but they don't provide the native
code compiled for the 6510.

~~~
melling
Is there a name given to your type of argument? The idea is to simply reply
with an an absurd extreme counter example. People use it all the time. Perhaps
it's some sort of extrapolation argument?

~~~
huggyface
Reductio Ad Absurdum (e.g. "for Microsoft to support anyone but themselves
they thus must support every fringe platform, including those popular twenty
years ago"). It's a particularly boring tactic of response and never adds
anything to the conversation.

------
jameswyse
I'm starting to like the new Microsoft.

~~~
dmboyd
All they need now is to bundle in mingw32 + msys.

------
binarymax
For those on *nix, there is this: <https://github.com/w1nk/node-odbc>

It's not native SQL server, but does the job.

------
jallmann
I don't write for Node nor SQL Server, but that connection string looks
gnarly. Is there a reason for not using a plain object that could then be
merged with a set of internal defaults, then serialized from there? Ruby uses
this pattern often, it's very clean and idiomatic.

~~~
gouranga
Yes. It is standard on windows to use connection strings. Also it stops then
node.js driver being coupled to particular SQL client versions.

It does look rather gnarly but if you work with it for a bit, you will find
that connection strings are incredibly powerful.

------
mdaniel
I was expecting to see that someone ported jTDS
(<http://jtds.sourceforge.net/>) to JavaScript. I have zero idea if something
like Emscripten could be used for an effort like that, nor if it would be
performant enough for use in a database scenario, but I think a pure
JavaScript library would probably be useful to a wider audience.

~~~
pekim
<http://github.com/pekim/tedious> is a pure JavaScript implementation of (some
of) the TDS protocol.

[Disclaimer: I'm the author.]

------
kop48
I've opened an issue to discuss the options for the connection object/array.

Please feel free to let us know what you believe is a good approach!

<https://github.com/WindowsAzure/node-sqlserver/issues/17>

Thanks,

Jonathan @kop48

