From fbf4653f909d6ead7dff16ea61394d7bc74702bc Mon Sep 17 00:00:00 2001 From: dingbo Date: Wed, 31 Aug 2022 13:34:49 +0800 Subject: [PATCH] test: node example --- docs/examples/node/connect.js | 4 ++-- docs/examples/python/develop_tutorial.py | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/examples/node/connect.js b/docs/examples/node/connect.js index aa5058bd50..80ac5d82f4 100644 --- a/docs/examples/node/connect.js +++ b/docs/examples/node/connect.js @@ -1,4 +1,4 @@ -const { options, connect } = require("td2.0-rest-connector"); +import { options, connect } from "@tdengine/rest"; async function test() { options.url = process.env.TDENGINE_CLOUD_URL; @@ -6,7 +6,7 @@ async function test() { let conn = connect(options); let cursor = conn.cursor(); try { - let res = await cursor.query("select server_version()"); + let res = await cursor.query("show databases()"); res.toString(); } catch (err) { console.log(err); diff --git a/docs/examples/python/develop_tutorial.py b/docs/examples/python/develop_tutorial.py index 0d7a1c0e9a..9d2b35e8b2 100644 --- a/docs/examples/python/develop_tutorial.py +++ b/docs/examples/python/develop_tutorial.py @@ -11,8 +11,6 @@ url = os.environ["TDENGINE_CLOUD_URL"] token = os.environ["TDENGINE_CLOUD_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: insert # create super table -- GitLab