šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

influx-ql

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

influx-ql

Simple way for influx ql

2.11.1
latest
Source
npm
Version published
Weekly downloads
3.4K
-24.7%
Maintainers
1
Weekly downloads
Ā 
Created
Source

Influx-ql

Build Status Coverage Status npm Github Releases

Influxdb-nodejs An Influxdb Node.js Client depends on Influx-ql.

Get influx ql

const QL = require('influx-ql');
const ql = new QL('mydb');
ql.measurement = 'http';
ql.RP = 'default';
ql.addField('status', 'spdy', 'fetch time');
ql.start = '2016-01-01';
ql.end = '-3h';
ql.limit = 10;
ql.slimit = 5;
ql.order = 'desc';
ql.offset = 10;
ql.soffset = 5;
ql.tz = 'America/Chicago';
ql.where('code', 400);
ql.where('"use" <= 30');
// select "fetch time","spdy","status" from "mydb"."default"."http" where "code" = 400 and "use" <= 30 and time <= now() - 3h and time >= '2016-01-01' order by time desc limit 10 slimit 5 offset 10 soffset 5 tz('America/Chicago')
ql.toSelect();

The enhance where function

const QL = require('influx-ql');
const ql = new QL('mydb');
ql.measurement = 'http';

// select * from "mydb".."http" where "spdy" = '1'
ql.where("spdy", "1");
ql.emptyConditions();

// select * from "mydb".."http" where ("spdy" = '1' or "spdy" = '2')
ql.where("spdy", ["1", "2"]);
ql.emptyConditions();

// select * from "mydb".."http" where "use" >= 300
ql.where("use", 300, ">=");
ql.emptyConditions();

// select * from "mydb".."http" where ("spdy" = '1' and "method" = 'GET')
ql.where({spdy: "1", method: "GET"});
ql.emptyConditions();

// select * from "mydb".."http" where ("spdy" != '1' and "method" != 'GET')
ql.where({spdy: "1", method: "GET"}, '!=');
ql.emptyConditions();

// select * from "mydb".."http" where ("spdy" = '1' or "method" = 'GET')
ql.where({spdy: "1", method: "GET"}, "or");
ql.emptyConditions();

// select * from "mydb".."http" where (spdy = '1' and method = 'GET')
ql.where("spdy = '1' and method = 'GET'");
ql.emptyConditions();

// select * from "mydb".."http" where "spdy" = /1|2/
ql.where({spdy: /1|2/});
ql.emptyConditions();

// select * from "mydb".."http" where "method" = 'GET' or "spdy" = '1'
ql.where('spdy', '1');
ql.where('method', 'GET');
ql.relation = 'or';

// select sum("max") from (select max("fetch time") from "mydb".."http" group by "spdy")
ql.clean();
ql.measurement = 'http';
ql.addFunction('max', 'fetch time');
ql.addGroup('spdy');
ql.subQuery();
ql.addFunction('sum', 'max');

Installation

$ npm i influx-ql

Examples

View the ./examples directory for working examples.

API

API

License

MIT

Keywords

influxdb

FAQs

Package last updated on 15 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts