npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-mssqlpro

v1.0.0

Published

一个 mssql 客户端,有一套使用方便的 api 去做 DDL、DML。

Downloads

10

Readme

node-mssqlpro

Microsoft SQL Server客户端,用于Node.js。基于 mssql@6 ,并在此基础上封装了一些使用方便的 api 去做 DDL、DML。

安装

npm install node-mssqlpro 

使用

连接池的创建与使用

const conPool = require('node-mssqlpro')
// 数据库连接配置
const conConfig = {
  server: 'ip地址或域名',
  user: '数据库用户名',
  password: '用户密码',
  database: '数据库名',
  options: {
    /**
     * 是否开启TLS加密连接,如果要开启,而且你的node版本>=12,server属性值必须为域名,不支持ip地址格式。
     */
    encrypt: false,
  }
}
const func = async () => {
  // 连接池名是一个连接池的唯一标识,此方法根据连接池名从连接池组里获取连接池。
  // 如果该连接池名已存在,则直接从连接池组获取并返回,
  // 否则根据传入的 conConfig 参数新建一个连接池并以该连接池名标识,放入连接池组并返回。
  const pool = await conPool.get('连接池名', conConfig)
  
  // pool 有众多方法,可以做各种各样的 sql 查询,
  // 为了演示连接池的使用,在这里只展示 query 方法 一种,其余方法文档后面会有详细的示例。
  // 查询 table 表第一条记录
  const result = await pool.query('select top 1 * from table')
  console.log(result[0])
  
  // 关闭连接池
  pool.close()
}
func()
  
// 关闭所有连接池
conPool.closeAll()

其他方法(select、selectWithJoin、get、insert、update、delete...)的使用示例敬请期待。。。

版本更新说明

1.0.0 (2024-04-06)

第一版发布

许可证

MIT