Comparing version 5.5.3 to 5.6.0
@@ -140,2 +140,7 @@ /// <reference types="node" /> | ||
database?: string; | ||
/** | ||
* Any placeholders used by the query. Using these is strongly recommended | ||
* to avoid injection attacks. | ||
*/ | ||
placeholders?: Record<string, string>; | ||
} | ||
@@ -213,6 +218,10 @@ /** | ||
* select * from response_times | ||
* where host = ${Influx.escape.stringLit(os.hostname())} | ||
* where host = $<host> | ||
* order by time desc | ||
* limit 10 | ||
* `) | ||
* `, { | ||
* placeholders: { | ||
* host: os.hostname() | ||
* } | ||
* }) | ||
* }).then(rows => { | ||
@@ -219,0 +228,0 @@ * rows.forEach(row => console.log(`A request to ${row.path} took ${row.duration}ms`)) |
@@ -134,6 +134,10 @@ "use strict"; | ||
* select * from response_times | ||
* where host = ${Influx.escape.stringLit(os.hostname())} | ||
* where host = $<host> | ||
* order by time desc | ||
* limit 10 | ||
* `) | ||
* `, { | ||
* placeholders: { | ||
* host: os.hostname() | ||
* } | ||
* }) | ||
* }).then(rows => { | ||
@@ -929,3 +933,3 @@ * rows.forEach(row => console.log(`A request to ${row.path} took ${row.duration}ms`)) | ||
queryRaw(query, options = {}) { | ||
const { database = this._defaultDB(), retentionPolicy } = options; | ||
const { database = this._defaultDB(), retentionPolicy, placeholders = {}, } = options; | ||
if (query instanceof Array) { | ||
@@ -939,2 +943,3 @@ query = query.join(";"); | ||
rp: retentionPolicy, | ||
params: placeholders, | ||
})); | ||
@@ -941,0 +946,0 @@ } |
{ | ||
"name": "influx", | ||
"version": "5.5.3", | ||
"version": "5.6.0", | ||
"description": "InfluxDB Client", | ||
@@ -39,3 +39,4 @@ "main": "./lib/src/index.js", | ||
"Connor Peet <connor@peet.io>", | ||
"Steffen Konerow <steffen@nrg-media.de> (http://www.nrg-media.de)" | ||
"Steffen Konerow <steffen@nrg-media.de> (http://www.nrg-media.de)", | ||
"Timm Murray <tmurray@wumpus-cave.net> (http://wumpus-cave.net)" | ||
], | ||
@@ -42,0 +43,0 @@ "license": "MIT", |
148834
4061