DLSS Swapper完整教程:如何一键智能管理游戏DLSS版本,免费提升45%性能
2026/7/17 14:06:58
要使用 Node.js 连接 SQL Server,首先需要安装 Tedious 驱动并准备好环境。按照微软文档(www.microsoft.com/sql-server/developer-get-started/node/windows/step/2.html)的说明,可以在 Visual Studio Code 的集成终端中,在保存程序的文件夹里执行以下命令:
npm init -y npm install tedious npm install async关于使用 Tedious 驱动为 Node.js 与 SQL Server 编写程序的文档参考,可查看 API 文档(http://tediousjs.github.io/tedious/index.html),更多示例可在(https://github.com/tediousjs/tedious/tree/master/examples)找到。
使用 Node.js 连接 SQL Server 依赖于 Tedious 驱动的 Connection 对象。以下是连接到 Linux 上的 SQL Server 并使用默认数据库WideWorldImporters的代码示例,可在 Visual Studio Code 编辑器中打开customerappconnect.js文件查看: