3.1.5 • Published 16 days ago

@cityssm/mssql-multi-pool v3.1.5

Weekly downloads
70
License
MIT
Repository
github
Last release
16 days ago

mssql-multi-pool

npm Maintainability codecov Coverage Testing DeepSource

A simple way to manage connections to multiple SQL Server databases using the Node.js Tedious driver.

Why?

The fantastic node-mssql package provides an easy and reliable way to connect to one SQL Server instance.

Connecting to multiple SQL Server instances is where things get trickier. Not too tricky, but it is more involved as you can't rely on the global pool. There is some sample code in the node-mssql README that shows how to do it. This project implements that sample code.

Installation

npm install @cityssm/mssql-multi-pool

Usage

Replace the connect(config); command from the mssql package with the connect(config); command from the @cityssm/mssql-multi-pool package.

If the configuration object describes an unseen database, a new pool is made. Otherwise, the previously made pool is used.

import * as sql from '@cityssm/mssql-multi-pool'

;(async function () {
  try {
    let pool = await sql.connect(config)

    // Use the `mssql` package like before.
  } catch (e) {}
})()
3.1.5

16 days ago

3.1.4

18 days ago

3.1.3

19 days ago

3.1.2

19 days ago

3.1.1

19 days ago

3.1.0

24 days ago

2.2.4

10 months ago

3.0.0

6 months ago

2.2.3

11 months ago

2.2.2

11 months ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.1.0-beta.1

3 years ago

2.1.0-beta.0

3 years ago

2.0.0

3 years ago

1.5.0

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.2.0-beta.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

4 years ago