节点。js和Microsoft SQL Server

时间:2022-01-11 15:37:23

Is there any way I can get my Node.js app to communicate with Microsoft SQL? I haven't seen any MS SQL drivers out there in the wild?

我有办法得到我的结点吗?js应用与Microsoft SQL通信?我在野外没有看到过任何SQL驱动程序吗?

I'm putting a very simple app together and need to be able to communicate with an existing MS SQL database (otherwise I would have gone with mongoDB or Redis)

我将一个非常简单的应用程序放在一起,需要能够与现有的MS SQL数据库进行通信(否则我将使用mongoDB或Redis)

14 个解决方案

#1


21  

We just released preview drivers for Node.JS for SQL Server connectivity. You can find them here: http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

我们刚刚发布了Node的预览驱动程序。用于SQL服务器连接的JS。您可以在这里找到它们:http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/ -microsoft-driver-for-node-js- server.aspx

#2


44  

The original question is old and now using node-mssql as answered by @Patrik Šimek that wraps Tedious as answered by @Tracker1 is the best way to go.

最初的问题是旧的,现在使用node-mssql回答@PatrikŠimek包装乏味@Tracker1回答的是最好的路要走。

The Windows/Azure node-sqlserver driver as mentioned in the accepted answer requires you to install a crazy list of prerequisites: Visual C++ 2010, SQL Server Native Client 11.0, python 2.7.x and probably also Windows 7 SDK for 64-bit on your server. You don't want to install all these GB's of software on your Windows Server if you ask me.

在已接受的答案中提到的Windows/Azure node-sqlserver驱动程序要求您安装一个疯狂的先决条件列表:Visual c++ 2010、SQL Server本机客户端11.0、python 2.7。还有Windows 7 SDK,适用于64位服务器。如果你问我的话,你不会想要在你的Windows服务器上安装所有这些GB的软件。

You really want to use Tedious. But also use node-mssql to wrap it and make coding a lot easier.

你真的想用乏味的东西。但是也要使用node-mssql来包装它,使代码编写更加容易。

Update August 2014

2014年8月更新

  • Both modules are still actively maintained. Issues are responded on quite quickly and efficiently.
  • 这两个模块仍然被积极地维护。问题的反应非常迅速和有效。
  • Both modules support SQL Server 2000 - 2014
  • 两个模块都支持SQL Server 2000 - 2014
  • Streaming supported since node-mssql 1.0.1
  • 从node-mssql 1.0.1开始支持流

Update February 2015 - 2.x (stable, npm)

更新2015年2月- 2日。x(稳定,npm)

  • Updated to latest Tedious 1.10
  • 更新到最新的乏味的1.10
  • Promises
  • 承诺
  • Pipe request to object stream
  • 管道请求到对象流
  • Detailed SQL errors
  • 详细的SQL错误
  • Transaction abort handling
  • 交易中止处理
  • Integrated type checks
  • 集成的类型检查
  • CLI
  • CLI
  • Minor fixes
  • 只是小修小补

This is plain Tedious:

这是普通乏味:

var Connection = require('tedious').Connection;
var Request = require('tedious').Request;

var config = {
  server: '192.168.1.212',
  userName: 'test',
  password: 'test'
};

var connection = new Connection(config);

connection.on('connect', function(err) {
    executeStatement();
  }
);

function executeStatement() {
  request = new Request("select 42, 'hello world'", function(err, rowCount) {
    if (err) {
      console.log(err);
    } else {
      console.log(rowCount + ' rows');
    }

    connection.close();
  });

  request.on('row', function(columns) {
    columns.forEach(function(column) {
      if (column.value === null) {
        console.log('NULL');
      } else {
        console.log(column.value);
      }
    });
  });

  request.on('done', function(rowCount, more) {
    console.log(rowCount + ' rows returned');
  });

  // In SQL Server 2000 you may need: connection.execSqlBatch(request);
  connection.execSql(request);
}

Here comes node-mssql which has Tedious as a dependency. Use this!

接下来是node-mssql,它作为一个依赖项非常乏味。使用这个!

var sql     = require('mssql');

var config = {
  server: '192.168.1.212',
  user:     'test',
  password: 'test'
};

sql.connect(config, function(err) {
    var request = new sql.Request();
    request.query("select 42, 'hello world'", function(err, recordset) {
        console.log(recordset);
    });
});

#3


24  

A couple of new node.js SQL server clients have just released recently. I wrote one called node-tds and there is another called tedious

两个新节点。js SQL server客户端最近刚刚发布。我写了一个叫nodetds的,还有一个叫乏味的。

#4


10  

You could maybe use node-tds.js:

你可以使用node-tds.js:

An exciting implementation of the TDS protocol for node.js to allow communication with sql server...

一个令人兴奋的TDS协议的实现。允许与sql server通信…

USAGE:

用法:

var mssql = require('./mssql');
var sqlserver = new mssql.mssql();
sqlserver.connect({'Server':__IP__,'Port':'1433','Database':'','User Id':'','Password':''});
var result = sqlserver.execute("SELECT * FROM wherever;");

#5


8  

There is another module you can use - node-mssql. It uses other TDS modules as drivers and offer easy to use unified interface. It also add extra features and bug fixes.

您还可以使用另一个模块——node-mssql。它使用其他TDS模块作为驱动程序,提供易于使用的统一接口。它还添加了额外的特性和bug修复。

Extra features:

额外的功能:

  • Unified interface for multiple MSSQL drivers
  • 多MSSQL驱动的统一接口
  • Connection pooling with Transactions and Prepared statements
  • 连接池与事务和准备语句。
  • Parametrized Stored Procedures for all drivers
  • 所有驱动程序的参数化存储过程
  • Serialization of Geography and Geometry CLR types
  • 地理和几何CLR类型的序列化
  • Smart JS data type to SQL data type mapper
  • 智能JS数据类型到SQL数据类型映射器
  • Support both Promises and standard callbacks
  • 支持承诺和标准回调

#6


7  

(duplicating my answer from another question).

(重复另一个问题的答案)

I would recommend node-mssql, which is a nice wrapper for other connectors, the default being my previous choice (Tedious) bringing a bit nicer of an interface. This is a JavaScript implimentation, with no compilation requirements, meaning you can work in windows and non-windows environments alike.

我推荐node-mssql,它是其他连接器的一个很好的包装器,默认是我先前的选择(冗长),带来了更好的接口。这是JavaScript的一个重要特性,不需要编译,这意味着您可以在windows环境和非windows环境中工作。

Another option, if you don't mind bringing in .Net or Mono with a binary bridge would be to use edge.js. Which can be very nice if you want to leverage .Net libraries in node.js

另一个选择,如果你不介意引入。net或Mono与二进制桥接,可以使用edge.js。如果你想在node.js中利用。net库,那该多好啊

node-tds is abandoned, node-odbc doesn't work with windows, and the MS node-sqlserver driver doesn't seem to work on non-windows (and has some goofy requirements).

node-tds被抛弃,node-odbc不能用于windows,而MS node-sqlserver驱动程序似乎不能用于非windows(并且有一些愚蠢的需求)。

#7


5  

TSQLFTW - T-SQL For The WIN(dows) - by Fosco Marotto https://github.com/gfosco/tsqlftw

TSQLFTW - T-SQL For The WIN(dows) -作者:Fosco Marotto https://github.com/gfosco/tsqlftw

It is a C# and ADO .NET managed code solution, with a C++ wrapper that Node.js can import and work with.

它是一个c#和ADO . net托管代码解决方案,带有一个c++包装器。js可以导入和使用。


If you know .NET you could try WCF Data Services (ADO.NET Data Services); write an WCF app for data access and use odata (REST on steroids) to interact with the database

如果你知道。net,你可以试试WCF数据服务(ADO)。网络数据服务);编写一个WCF应用程序用于数据访问,并使用odata(在类固醇上休息)与数据库交互。


If you are into SOA and use SQL Server 2005 you could check out the Native XML Web Services for Microsoft SQL Server 2005

如果您喜欢SOA并使用SQL Server 2005,您可以查看Microsoft SQL Server 2005的原生XML Web服务

http://msdn.microsoft.com/en-us/library/ms345123(v=sql.90).aspx

http://msdn.microsoft.com/en-us/library/ms345123(v = sql.90). aspx

You could access SQL Server as a web service (HTTP, SOAP)

您可以将SQL Server作为web服务访问(HTTP、SOAP)

#8


4  

Microsoft (The Windows Azure Team) just released a node driver for SQL SERVER.

微软(Windows Azure Team)刚刚发布了SQL SERVER的节点驱动程序。

It has no package for npm yert, as far as I know, but it is open sourced. And the accepting community contribution too.

据我所知,npm yert没有包,但它是开源的。以及接受社区的贡献。

https://github.com/WindowsAzure/node-sqlserver

https://github.com/WindowsAzure/node-sqlserver

Introduction blog post here:

博客介绍:

http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

#9


2  

If you are running on .NET look at entityspaces.js at, we are creating an entire universal ORM for Node.js that will not require a WCF JSON service ... https://github.com/EntitySpaces/entityspaces.js

如果您正在。net上运行,请查看实体空间。我们正在为Node创建一个完整的通用ORM。不需要WCF JSON服务的js……https://github.com/EntitySpaces/entityspaces.js

If you are using MSFT backend technology you could use it now, however, we are creating a universal Node.js ORM and will have more information on that soon

如果您正在使用MSFT后端技术,您现在可以使用它,但是,我们正在创建一个通用节点。js ORM将会有更多关于这方面的信息。

#10


2  

There is an update from Microsoft. Here is a series of blog posts (part 1 and part 2).

微软有一个更新。这里是一系列的博客文章(第1部分和第2部分)。

#11


1  

Node.js SQL Server drivers seem very immature - there's a mish-mash of different projects with varying dependencies, performance, and levels of completeness, none of which inspire confidence.

节点。js SQL Server驱动程序看起来很不成熟,有不同的项目,它们之间有不同的依赖、性能和完整性,这些都没有激发信心。

I'd propose using edge-sql. This leverages .NET's mature database driver ecosystem, and depends only on .NET (a no-brainer if you are running node on Windows - if not there is Mono, but I have not tried that).

我建议使用edge-sql。这利用了。net成熟的数据库驱动生态系统,并且只依赖于。net(如果你在Windows上运行节点,这是显而易见的——如果没有Mono的话,我还没有尝试过)。

Here is a node example (server.js) using edge-sql (note you need to put your connection string into an environment variable as per edge-sql docs):

下面是一个使用edge-sql的节点示例(注意,您需要按照edge-sql文档将连接字符串放入一个环境变量中):

var edge = require('edge');

// edge-sql has built in support for T-SQL / MSSQL Server
var getData = edge.func('sql', function () {/*
    select top 10 * from sometable
*/
});

getData(null, function (error, result) {
    if (error) throw error;
    console.log(result);
});

You can also leverage Edge.js with .NET to access other databases, such as Oracle. I have given an example of that approach here.

你也可以利用Edge。使用。net访问其他数据库,如Oracle。我在这里举了一个例子。

#12


0  

The status as of May 2016 is as follows.

截至2016年5月的状态如下。

The official Microsoft SQL Driver for Node, called node-sqlserver, has not been updated for a number of years.

节点的官方Microsoft SQL驱动程序Node -sqlserver已经有很多年没有更新了。

There is a new fork on this called node-sqlserver-v8 that works with Node Versions 0.12.x. and >= 4.1.x. This fork also has pre-compiled binaries for x64 and x86 targets.

在这上面有一个新的fork,称为Node -sqlserver-v8,它与节点版本0.12.x一起工作。和> = 4.1.x。这个fork还为x64和x86目标预先编译了二进制文件。

The package is available on NPM as msnodesqlv8.

该软件包可以在NPM中作为msnodesqlv8提供。

I recommend this package because it is lightweight (has no dependencies) and it is the only one that works with all recent version of SQL Server, including SQL LocalDB.

我推荐这个包,因为它是轻量级的(没有依赖关系),而且它是唯一一个可以使用所有最新版本的SQL Server的包,包括SQL LocalDB。

#13


0  

Now (2016) you can use Sequelize ORM that supports:

现在(2016)你可以使用Sequelize ORM支持:

  • MySQL / MariaDB,
  • MySQL / MariaDB,
  • PostgreSQL
  • PostgreSQL
  • SQLite
  • SQLite
  • Microsoft SQL Server
  • Microsoft SQL Server

It is widely used according to its Github's stars.

它被广泛地应用于其Github的恒星。

#14


-3  

that link details only a sql 2000 solution, not sql 2005 nor sql 2008, and also that code only allow sending sql text, and does not allow the execution of stored procedures.

该链接只提供sql 2000解决方案,而不是sql 2005或sql 2008,而且该代码只允许发送sql文本,并且不允许执行存储过程。

The real solution would be to install node JS on a linux server, or on a virtual linux server on a windows machine, and then go to microsoft web site and download the JDBC java drivers and install those microsoft ms sql java jdbc drivers on either the linux server or linux virtual server.

真正的解决方案是安装节点JS在linux服务器上,或在一个虚拟的linux服务器在windows机器上,然后去微软网站下载JDBC java驱动程序和安装的微软ms sql的java JDBC驱动程序在linux服务器或linux虚拟服务器。

#1


21  

We just released preview drivers for Node.JS for SQL Server connectivity. You can find them here: http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

我们刚刚发布了Node的预览驱动程序。用于SQL服务器连接的JS。您可以在这里找到它们:http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/ -microsoft-driver-for-node-js- server.aspx

#2


44  

The original question is old and now using node-mssql as answered by @Patrik Šimek that wraps Tedious as answered by @Tracker1 is the best way to go.

最初的问题是旧的,现在使用node-mssql回答@PatrikŠimek包装乏味@Tracker1回答的是最好的路要走。

The Windows/Azure node-sqlserver driver as mentioned in the accepted answer requires you to install a crazy list of prerequisites: Visual C++ 2010, SQL Server Native Client 11.0, python 2.7.x and probably also Windows 7 SDK for 64-bit on your server. You don't want to install all these GB's of software on your Windows Server if you ask me.

在已接受的答案中提到的Windows/Azure node-sqlserver驱动程序要求您安装一个疯狂的先决条件列表:Visual c++ 2010、SQL Server本机客户端11.0、python 2.7。还有Windows 7 SDK,适用于64位服务器。如果你问我的话,你不会想要在你的Windows服务器上安装所有这些GB的软件。

You really want to use Tedious. But also use node-mssql to wrap it and make coding a lot easier.

你真的想用乏味的东西。但是也要使用node-mssql来包装它,使代码编写更加容易。

Update August 2014

2014年8月更新

  • Both modules are still actively maintained. Issues are responded on quite quickly and efficiently.
  • 这两个模块仍然被积极地维护。问题的反应非常迅速和有效。
  • Both modules support SQL Server 2000 - 2014
  • 两个模块都支持SQL Server 2000 - 2014
  • Streaming supported since node-mssql 1.0.1
  • 从node-mssql 1.0.1开始支持流

Update February 2015 - 2.x (stable, npm)

更新2015年2月- 2日。x(稳定,npm)

  • Updated to latest Tedious 1.10
  • 更新到最新的乏味的1.10
  • Promises
  • 承诺
  • Pipe request to object stream
  • 管道请求到对象流
  • Detailed SQL errors
  • 详细的SQL错误
  • Transaction abort handling
  • 交易中止处理
  • Integrated type checks
  • 集成的类型检查
  • CLI
  • CLI
  • Minor fixes
  • 只是小修小补

This is plain Tedious:

这是普通乏味:

var Connection = require('tedious').Connection;
var Request = require('tedious').Request;

var config = {
  server: '192.168.1.212',
  userName: 'test',
  password: 'test'
};

var connection = new Connection(config);

connection.on('connect', function(err) {
    executeStatement();
  }
);

function executeStatement() {
  request = new Request("select 42, 'hello world'", function(err, rowCount) {
    if (err) {
      console.log(err);
    } else {
      console.log(rowCount + ' rows');
    }

    connection.close();
  });

  request.on('row', function(columns) {
    columns.forEach(function(column) {
      if (column.value === null) {
        console.log('NULL');
      } else {
        console.log(column.value);
      }
    });
  });

  request.on('done', function(rowCount, more) {
    console.log(rowCount + ' rows returned');
  });

  // In SQL Server 2000 you may need: connection.execSqlBatch(request);
  connection.execSql(request);
}

Here comes node-mssql which has Tedious as a dependency. Use this!

接下来是node-mssql,它作为一个依赖项非常乏味。使用这个!

var sql     = require('mssql');

var config = {
  server: '192.168.1.212',
  user:     'test',
  password: 'test'
};

sql.connect(config, function(err) {
    var request = new sql.Request();
    request.query("select 42, 'hello world'", function(err, recordset) {
        console.log(recordset);
    });
});

#3


24  

A couple of new node.js SQL server clients have just released recently. I wrote one called node-tds and there is another called tedious

两个新节点。js SQL server客户端最近刚刚发布。我写了一个叫nodetds的,还有一个叫乏味的。

#4


10  

You could maybe use node-tds.js:

你可以使用node-tds.js:

An exciting implementation of the TDS protocol for node.js to allow communication with sql server...

一个令人兴奋的TDS协议的实现。允许与sql server通信…

USAGE:

用法:

var mssql = require('./mssql');
var sqlserver = new mssql.mssql();
sqlserver.connect({'Server':__IP__,'Port':'1433','Database':'','User Id':'','Password':''});
var result = sqlserver.execute("SELECT * FROM wherever;");

#5


8  

There is another module you can use - node-mssql. It uses other TDS modules as drivers and offer easy to use unified interface. It also add extra features and bug fixes.

您还可以使用另一个模块——node-mssql。它使用其他TDS模块作为驱动程序,提供易于使用的统一接口。它还添加了额外的特性和bug修复。

Extra features:

额外的功能:

  • Unified interface for multiple MSSQL drivers
  • 多MSSQL驱动的统一接口
  • Connection pooling with Transactions and Prepared statements
  • 连接池与事务和准备语句。
  • Parametrized Stored Procedures for all drivers
  • 所有驱动程序的参数化存储过程
  • Serialization of Geography and Geometry CLR types
  • 地理和几何CLR类型的序列化
  • Smart JS data type to SQL data type mapper
  • 智能JS数据类型到SQL数据类型映射器
  • Support both Promises and standard callbacks
  • 支持承诺和标准回调

#6


7  

(duplicating my answer from another question).

(重复另一个问题的答案)

I would recommend node-mssql, which is a nice wrapper for other connectors, the default being my previous choice (Tedious) bringing a bit nicer of an interface. This is a JavaScript implimentation, with no compilation requirements, meaning you can work in windows and non-windows environments alike.

我推荐node-mssql,它是其他连接器的一个很好的包装器,默认是我先前的选择(冗长),带来了更好的接口。这是JavaScript的一个重要特性,不需要编译,这意味着您可以在windows环境和非windows环境中工作。

Another option, if you don't mind bringing in .Net or Mono with a binary bridge would be to use edge.js. Which can be very nice if you want to leverage .Net libraries in node.js

另一个选择,如果你不介意引入。net或Mono与二进制桥接,可以使用edge.js。如果你想在node.js中利用。net库,那该多好啊

node-tds is abandoned, node-odbc doesn't work with windows, and the MS node-sqlserver driver doesn't seem to work on non-windows (and has some goofy requirements).

node-tds被抛弃,node-odbc不能用于windows,而MS node-sqlserver驱动程序似乎不能用于非windows(并且有一些愚蠢的需求)。

#7


5  

TSQLFTW - T-SQL For The WIN(dows) - by Fosco Marotto https://github.com/gfosco/tsqlftw

TSQLFTW - T-SQL For The WIN(dows) -作者:Fosco Marotto https://github.com/gfosco/tsqlftw

It is a C# and ADO .NET managed code solution, with a C++ wrapper that Node.js can import and work with.

它是一个c#和ADO . net托管代码解决方案,带有一个c++包装器。js可以导入和使用。


If you know .NET you could try WCF Data Services (ADO.NET Data Services); write an WCF app for data access and use odata (REST on steroids) to interact with the database

如果你知道。net,你可以试试WCF数据服务(ADO)。网络数据服务);编写一个WCF应用程序用于数据访问,并使用odata(在类固醇上休息)与数据库交互。


If you are into SOA and use SQL Server 2005 you could check out the Native XML Web Services for Microsoft SQL Server 2005

如果您喜欢SOA并使用SQL Server 2005,您可以查看Microsoft SQL Server 2005的原生XML Web服务

http://msdn.microsoft.com/en-us/library/ms345123(v=sql.90).aspx

http://msdn.microsoft.com/en-us/library/ms345123(v = sql.90). aspx

You could access SQL Server as a web service (HTTP, SOAP)

您可以将SQL Server作为web服务访问(HTTP、SOAP)

#8


4  

Microsoft (The Windows Azure Team) just released a node driver for SQL SERVER.

微软(Windows Azure Team)刚刚发布了SQL SERVER的节点驱动程序。

It has no package for npm yert, as far as I know, but it is open sourced. And the accepting community contribution too.

据我所知,npm yert没有包,但它是开源的。以及接受社区的贡献。

https://github.com/WindowsAzure/node-sqlserver

https://github.com/WindowsAzure/node-sqlserver

Introduction blog post here:

博客介绍:

http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

http://blogs.msdn.com/b/sqlphp/archive/2012/06/08/introducing-the-microsoft-driver-for-node-js-for-sql-server.aspx

#9


2  

If you are running on .NET look at entityspaces.js at, we are creating an entire universal ORM for Node.js that will not require a WCF JSON service ... https://github.com/EntitySpaces/entityspaces.js

如果您正在。net上运行,请查看实体空间。我们正在为Node创建一个完整的通用ORM。不需要WCF JSON服务的js……https://github.com/EntitySpaces/entityspaces.js

If you are using MSFT backend technology you could use it now, however, we are creating a universal Node.js ORM and will have more information on that soon

如果您正在使用MSFT后端技术,您现在可以使用它,但是,我们正在创建一个通用节点。js ORM将会有更多关于这方面的信息。

#10


2  

There is an update from Microsoft. Here is a series of blog posts (part 1 and part 2).

微软有一个更新。这里是一系列的博客文章(第1部分和第2部分)。

#11


1  

Node.js SQL Server drivers seem very immature - there's a mish-mash of different projects with varying dependencies, performance, and levels of completeness, none of which inspire confidence.

节点。js SQL Server驱动程序看起来很不成熟,有不同的项目,它们之间有不同的依赖、性能和完整性,这些都没有激发信心。

I'd propose using edge-sql. This leverages .NET's mature database driver ecosystem, and depends only on .NET (a no-brainer if you are running node on Windows - if not there is Mono, but I have not tried that).

我建议使用edge-sql。这利用了。net成熟的数据库驱动生态系统,并且只依赖于。net(如果你在Windows上运行节点,这是显而易见的——如果没有Mono的话,我还没有尝试过)。

Here is a node example (server.js) using edge-sql (note you need to put your connection string into an environment variable as per edge-sql docs):

下面是一个使用edge-sql的节点示例(注意,您需要按照edge-sql文档将连接字符串放入一个环境变量中):

var edge = require('edge');

// edge-sql has built in support for T-SQL / MSSQL Server
var getData = edge.func('sql', function () {/*
    select top 10 * from sometable
*/
});

getData(null, function (error, result) {
    if (error) throw error;
    console.log(result);
});

You can also leverage Edge.js with .NET to access other databases, such as Oracle. I have given an example of that approach here.

你也可以利用Edge。使用。net访问其他数据库,如Oracle。我在这里举了一个例子。

#12


0  

The status as of May 2016 is as follows.

截至2016年5月的状态如下。

The official Microsoft SQL Driver for Node, called node-sqlserver, has not been updated for a number of years.

节点的官方Microsoft SQL驱动程序Node -sqlserver已经有很多年没有更新了。

There is a new fork on this called node-sqlserver-v8 that works with Node Versions 0.12.x. and >= 4.1.x. This fork also has pre-compiled binaries for x64 and x86 targets.

在这上面有一个新的fork,称为Node -sqlserver-v8,它与节点版本0.12.x一起工作。和> = 4.1.x。这个fork还为x64和x86目标预先编译了二进制文件。

The package is available on NPM as msnodesqlv8.

该软件包可以在NPM中作为msnodesqlv8提供。

I recommend this package because it is lightweight (has no dependencies) and it is the only one that works with all recent version of SQL Server, including SQL LocalDB.

我推荐这个包,因为它是轻量级的(没有依赖关系),而且它是唯一一个可以使用所有最新版本的SQL Server的包,包括SQL LocalDB。

#13


0  

Now (2016) you can use Sequelize ORM that supports:

现在(2016)你可以使用Sequelize ORM支持:

  • MySQL / MariaDB,
  • MySQL / MariaDB,
  • PostgreSQL
  • PostgreSQL
  • SQLite
  • SQLite
  • Microsoft SQL Server
  • Microsoft SQL Server

It is widely used according to its Github's stars.

它被广泛地应用于其Github的恒星。

#14


-3  

that link details only a sql 2000 solution, not sql 2005 nor sql 2008, and also that code only allow sending sql text, and does not allow the execution of stored procedures.

该链接只提供sql 2000解决方案,而不是sql 2005或sql 2008,而且该代码只允许发送sql文本,并且不允许执行存储过程。

The real solution would be to install node JS on a linux server, or on a virtual linux server on a windows machine, and then go to microsoft web site and download the JDBC java drivers and install those microsoft ms sql java jdbc drivers on either the linux server or linux virtual server.

真正的解决方案是安装节点JS在linux服务器上,或在一个虚拟的linux服务器在windows机器上,然后去微软网站下载JDBC java驱动程序和安装的微软ms sql的java JDBC驱动程序在linux服务器或linux虚拟服务器。