modify node ci example
This commit is contained in:
parent
3834e1ccf6
commit
bc2863645c
|
@ -54,17 +54,18 @@ async function createDbAndTable() {
|
||||||
// ANCHOR: insertData
|
// ANCHOR: insertData
|
||||||
async function insertData() {
|
async function insertData() {
|
||||||
let wsSql = null
|
let wsSql = null
|
||||||
|
let insertQuery = "INSERT INTO " +
|
||||||
|
"power.d1001 USING power.meters (location, groupId) TAGS('California.SanFrancisco', 2) " +
|
||||||
|
"VALUES " +
|
||||||
|
"(NOW + 1a, 10.30000, 219, 0.31000) " +
|
||||||
|
"(NOW + 2a, 12.60000, 218, 0.33000) " +
|
||||||
|
"(NOW + 3a, 12.30000, 221, 0.31000) " +
|
||||||
|
"power.d1002 USING power.meters TAGS('California.SanFrancisco', 3) " +
|
||||||
|
"VALUES " +
|
||||||
|
"(NOW + 1a, 10.30000, 218, 0.25000) ";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
wsSql = await createConnect();
|
wsSql = await createConnect();
|
||||||
let insertQuery = "INSERT INTO " +
|
|
||||||
"power.d1001 USING power.meters (location, groupId) TAGS('California.SanFrancisco', 2) " +
|
|
||||||
"VALUES " +
|
|
||||||
"(NOW + 1a, 10.30000, 219, 0.31000) " +
|
|
||||||
"(NOW + 2a, 12.60000, 218, 0.33000) " +
|
|
||||||
"(NOW + 3a, 12.30000, 221, 0.31000) " +
|
|
||||||
"power.d1002 USING power.meters TAGS('California.SanFrancisco', 3) " +
|
|
||||||
"VALUES " +
|
|
||||||
"(NOW + 1a, 10.30000, 218, 0.25000) ";
|
|
||||||
taosResult = await wsSql.exec(insertQuery);
|
taosResult = await wsSql.exec(insertQuery);
|
||||||
console.log("Successfully inserted " + taosResult.getAffectRows() + " rows to power.meters.");
|
console.log("Successfully inserted " + taosResult.getAffectRows() + " rows to power.meters.");
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in New Issue