- release binaries for electron v29,v30,v31,v32 (v28 not supported, v32 needs 020 compiler) #324
- node v22, v23 binaries
- patch PR from contributor on date parsing #318
- update packages to latest
- reworked typings to better interop with JS/TS
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)
})