Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 9, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
msnodesqlv8 4.4.0 -> 4.5.0 age adoption passing confidence

Release Notes

TimelordUK/node-sqlserver-v8 (msnodesqlv8)

v4.5.0

Compare Source

Automated release for v4.5.0, replicating previous assets.

24/05/2025 added node v24 binaries

What's Changed

This adds some much needed support for doing transactions from a pool with a few helper utilities.
Notable new API methods:

pool.beginTransaction(function (err, description) { /* description.connection.query() */ })

Pulls a connection information out of the pool and gives it to the caller. This connection becomes busy for the duration until either of next two functions are called:

pool.commitTransaction(description, function(err) { /* err logging */ })

Calls IF (@​@​TRANCOUNT > 0) COMMIT TRANSACTION on the connection in the description and releases it back into the pool allowing it to be used by others.

pool.rollbackTransaction(description, function(err) { /* err logging */ })

Calls IF (@​@​TRANCOUNT > 0) ROLLBACK TRANSACTION on the connection in the description and releases it back into the pool allowing it to be used by others.

Both functions are also available in the promised pool:

let description = await pool.promises.beginTransaction()
try {
  await description.connection.promises.query(`
    SELECT * from my_table WITH (updlock, holdlock)
  `)
  // do some other stuff
  await pool.promises.commitTransaction(description)
} catch (err) {
  await pool.promises.rollbackTransaction(description)
  // log err
}

Lastly, a nice little promise-specific utlity has been added:

pool.promises.transaction(async function (description) {
  /* I'm inside a transaction */
  await description.connection.promises.query(`Do transaction query here`)
})

This calls the callback and wraps it inside of a transaction with auto commit on success and auto rollback on any thrown errors.

Full Changelog: TimelordUK/node-sqlserver-v8@v4.3.0...v4.5.0

description link
next js example, note cant run driver on UI thread. todo-with-nextjs_msnodesqlv8
using in typescript msnodesqlv8_ts_sample
js example typings in IDE msnodesqlv8_yarn_sample
using sequelize msnodesqlv8-sequelize
using mssql msnodesqlv8_mssql_sample
using electron msnodesqlv8-electron
import sql from 'msnodesqlv8'
import Connection = MsNodeSqlV8.Connection
import ConnectionPromises = MsNodeSqlV8.ConnectionPromises
async function t() {
    const connectionString  = "Driver={ODBC Driver 17 for SQL Server};Server=(localdb)\\node;Database=scratch;Trusted_Connection=yes;"
    const con:Connection = await sql.promises.open(connectString)
    const promises:ConnectionPromises  = con.promises
    const res = await promises.query('select @​@​servername as server')
    console.log(JSON.stringify(res, null, 4))
    await con.promises.close()
}

t().then(() => {
    console.log('closed')
})
const connectionString  = "Driver={ODBC Driver 17 for SQL Server};Server=(localdb)\\node;Database=scratch;Trusted_Connection=yes;"

const sql = require('msnodesqlv8')

const query = 'SELECT top 2 * FROM syscolumns'

async function runner() {
    console.log(`using connection '${connectionString}' run query '${query}'`)
    const res = await sql.promises.query(connectionString, query)
    console.log(JSON.stringify(res, null, 4))
}

runner().then(() => {
    console.log('done.')
}).catch(e => {
    console.error(e)
})

image


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

@renovate renovate bot force-pushed the renovate/msnodesqlv8-4.x-lockfile branch from 73e2122 to 28f35e9 Compare May 19, 2025 19:49
@renovate renovate bot force-pushed the renovate/msnodesqlv8-4.x-lockfile branch from 28f35e9 to 2d7dff2 Compare September 25, 2025 20:41
@renovate renovate bot force-pushed the renovate/msnodesqlv8-4.x-lockfile branch from 2d7dff2 to e2a6a68 Compare October 21, 2025 15:44
@renovate renovate bot force-pushed the renovate/msnodesqlv8-4.x-lockfile branch from e2a6a68 to 8851673 Compare November 11, 2025 02:39
@renovate renovate bot force-pushed the renovate/msnodesqlv8-4.x-lockfile branch from 8851673 to 0d05d57 Compare November 18, 2025 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant