提交 fbf4653f 编写于 作者: D dingbo

test: node example

上级 26487998
const { options, connect } = require("td2.0-rest-connector"); import { options, connect } from "@tdengine/rest";
async function test() { async function test() {
options.url = process.env.TDENGINE_CLOUD_URL; options.url = process.env.TDENGINE_CLOUD_URL;
...@@ -6,7 +6,7 @@ async function test() { ...@@ -6,7 +6,7 @@ async function test() {
let conn = connect(options); let conn = connect(options);
let cursor = conn.cursor(); let cursor = conn.cursor();
try { try {
let res = await cursor.query("select server_version()"); let res = await cursor.query("show databases()");
res.toString(); res.toString();
} catch (err) { } catch (err) {
console.log(err); console.log(err);
......
...@@ -11,8 +11,6 @@ url = os.environ["TDENGINE_CLOUD_URL"] ...@@ -11,8 +11,6 @@ url = os.environ["TDENGINE_CLOUD_URL"]
token = os.environ["TDENGINE_CLOUD_TOKEN"] token = os.environ["TDENGINE_CLOUD_TOKEN"]
conn = taosrest.connect(url=url, token=token) conn = taosrest.connect(url=url, token=token)
# test the connection by getting version info
print("server version:", conn.server_info)
# ANCHOR_END: connect # ANCHOR_END: connect
# ANCHOR: insert # ANCHOR: insert
# create super table # create super table
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册