2022-08-03 11:10:13 +00:00
|
|
|
const { options, connect } = require("@tdengine/rest");
|
2022-05-21 03:11:57 +00:00
|
|
|
|
|
|
|
|
async function test() {
|
2022-08-12 11:55:01 +00:00
|
|
|
options.path = "/rest/sql";
|
2022-05-21 03:11:57 +00:00
|
|
|
options.host = "localhost";
|
2023-02-03 18:10:47 +00:00
|
|
|
options.port = 6041;
|
2022-05-21 03:11:57 +00:00
|
|
|
let conn = connect(options);
|
|
|
|
|
let cursor = conn.cursor();
|
|
|
|
|
try {
|
|
|
|
|
let res = await cursor.query("SELECT server_version()");
|
2023-02-03 18:10:47 +00:00
|
|
|
console.log("res.getResult()",res.getResult());
|
2022-05-21 03:11:57 +00:00
|
|
|
} catch (err) {
|
|
|
|
|
console.log(err);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
test();
|