Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mssql

Package Overview
Dependencies
Maintainers
4
Versions
170
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mssql - npm Package Compare versions

Comparing version 7.0.0-alpha.2 to 7.0.0-alpha.3

2

CHANGELOG.txt
v7.0.0 (2020-??-??)
-------------------
[change] Updated to latest Tedious 8
[change] Updated to latest Tedious 9
[change] Piped streams no longer have errors forwarded on to them ([1028](https://github.com/tediousjs/node-mssql/pull/1028))

@@ -5,0 +5,0 @@ [change] tedious config option `trustServerCertificate` defaults to `false` if not supplied ([1030](https://github.com/tediousjs/node-mssql/pull/1030))

@@ -24,3 +24,3 @@ {

],
"version": "7.0.0-alpha.2",
"version": "7.0.0-alpha.3",
"main": "index.js",

@@ -32,7 +32,7 @@ "repository": "github:tediousjs/node-mssql",

"tarn": "^1.1.5",
"tedious": "^8.3.0"
"tedious": "^9"
},
"devDependencies": {
"mocha": "^6.2.2",
"standard": "^14"
"standard": "^14.3.4"
},

@@ -39,0 +39,0 @@ "engines": {

@@ -97,2 +97,3 @@ # node-mssql

* [Table-Valued Parameter](#table-valued-parameter-tvp)
* [Response Schema](#response-schema)
* [Affected Rows](#affected-rows)

@@ -1510,2 +1511,27 @@ * [JSON support](#json-support)

## Response Schema
An object returned from a `sucessful` basic query would look like the following.
```javascript
{
recordsets: [
[
{
COL1: "some content",
COL2: "some more content"
}
]
],
recordset: [
{
COL1: "some content",
COL2: "some more content"
}
],
output: {},
rowsAffected: [1]
}
```
## Affected Rows

@@ -1512,0 +1538,0 @@

@@ -1,2 +0,1 @@

'use strict'

@@ -8,8 +7,13 @@

password: 'P@ssw0rd',
database: 'master',
database: 'StockDB',
stream: false,
options: {
trustServerCertificate: true,
enableArithAbort: true,
encrypt: true
},
pool: {
max: 1,
min: 0,
},
port: 1433,

@@ -20,31 +24,46 @@ user: 'sa',

const client = new mssql.ConnectionPool(sqlConfig);
const client = new mssql.ConnectionPool(sqlConfig)
let runInterval = null
async function run() {
try {
await client.connect();
await client.request().query(`
IF NOT EXISTS (SELECT * FROM sysobjects WHERE name='test_table' AND xtype='U')
BEGIN
CREATE TABLE [dbo].[test_table](
[userId] [uniqueidentifier] NOT NULL
)
END
`);
const result = await client.request().input('userId', mssql.UniqueIdentifier(), 'invalid-identifier').query(
'INSERT INTO [dbo].[test_table] ([userId]) VALUES (@userId)'
);
console.log(result);
} catch (e) {
// error should be caught here
console.log('Error');
console.log(e);
}
console.log('done');
process.exit();
async function run () {
const pool = await client.connect()
const request = pool.request()
console.time('query')
const clientId = 12
const startDate = '2018-01-01'
const endDate = '2020-06-18'
await request.input('clientId', mssql.Int, clientId)
.input('startDate', mssql.DateTime, new Date(startDate))
.input('endDate', mssql.DateTime, new Date(endDate))
.query(`SELECT v.Id as VehicleId,
n.Name as Make,
m.Name as Model,
v.Variant as Variant,
v.Registration as Registration,
v.Price As Price,
v.OfferPrice as OfferPrice,
v.OfferDisplay as OfferDisplay,
d.Name as DealershipName,
v.StockDate as StockDate,
v.PurchaseStandIn as SIV,
s.Name as PurchaseSource,
DATEDIFF(day, StockDate, GETDATE()) as DaysInStock,
v.SoldDate as SoldDate,
v.SoldPrice as SoldPrice,
s1.Name as SoldSource
FROM UsedVehicles v
JOIN Models m on m.Id = v.ModelId
JOIN Makes n ON n.Id = m.MakeId
JOIN Dealerships d on d.Id = v.DealershipId
LEFT JOIN UsedPriceSources s on s.Id = v.PurchasePriceSourceId
LEFT JOIN UsedPriceSources s1 on s1.Id = v.SoldPriceSourceId
WHERE v.Status = 3
AND v.ClientId = @clientId
AND v.SoldDate between @startDate AND @endDate
ORDER BY SoldDate ASC`)
console.timeEnd('query')
// console.log(result)
return client.close()
}
run();
run()
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc