modify node.js tmq case
This commit is contained in:
parent
d1bfc48439
commit
bdb96ee86d
|
@ -26,7 +26,6 @@ async function createDbAndTable() {
|
||||||
let conf = new taos.WSConfig(dsn);
|
let conf = new taos.WSConfig(dsn);
|
||||||
conf.setUser('root');
|
conf.setUser('root');
|
||||||
conf.setPwd('taosdata');
|
conf.setPwd('taosdata');
|
||||||
conf.setDb('power');
|
|
||||||
wsSql = await taos.sqlConnect(conf);
|
wsSql = await taos.sqlConnect(conf);
|
||||||
console.log("Connected to " + dsn + " successfully.");
|
console.log("Connected to " + dsn + " successfully.");
|
||||||
// create database
|
// create database
|
||||||
|
|
|
@ -40,7 +40,6 @@ async function prepare() {
|
||||||
let conf = new taos.WSConfig('ws://localhost:6041');
|
let conf = new taos.WSConfig('ws://localhost:6041');
|
||||||
conf.setUser('root');
|
conf.setUser('root');
|
||||||
conf.setPwd('taosdata');
|
conf.setPwd('taosdata');
|
||||||
conf.setDb('power');
|
|
||||||
const createDB = `CREATE DATABASE IF NOT EXISTS ${db}`;
|
const createDB = `CREATE DATABASE IF NOT EXISTS ${db}`;
|
||||||
const createStable = `CREATE STABLE IF NOT EXISTS ${db}.${stable} (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);`;
|
const createStable = `CREATE STABLE IF NOT EXISTS ${db}.${stable} (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);`;
|
||||||
|
|
||||||
|
|
|
@ -34,10 +34,10 @@ async function createConsumer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function prepare() {
|
async function prepare() {
|
||||||
let conf = new taos.WSConfig('ws://192.168.1.98:6041');
|
let conf = new taos.WSConfig('ws://localhost:6041');
|
||||||
conf.setUser('root');
|
conf.setUser('root');
|
||||||
conf.setPwd('taosdata');
|
conf.setPwd('taosdata');
|
||||||
conf.setDb('power');
|
|
||||||
const createDB = `CREATE DATABASE IF NOT EXISTS ${db}`;
|
const createDB = `CREATE DATABASE IF NOT EXISTS ${db}`;
|
||||||
const createStable = `CREATE STABLE IF NOT EXISTS ${db}.${stable} (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);`;
|
const createStable = `CREATE STABLE IF NOT EXISTS ${db}.${stable} (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);`;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue