diff --git a/documentation/tdenginedocs-en/connector/index.html b/documentation/tdenginedocs-en/connector/index.html index 77abc122e51fe831776ab9b60c487dbd9cacbce5..512da3ffc1944d82c9d5d8c50bfbbad0271565c3 100644 --- a/documentation/tdenginedocs-en/connector/index.html +++ b/documentation/tdenginedocs-en/connector/index.html @@ -177,7 +177,7 @@ public Connection getConn() throws Exception{
Use curl command to query all the data in table t1 of database demo:
curl -H 'Authorization: Basic cm9vdDp0YW9zZGF0YQ==' -d 'select * from demo.t1' 192.168.0.1:6020/rest/sql
If the above steps didn't work for you, please visit Microsoft's Node.js Guidelines for Windows for additional tips.
To target native ARM64 Node.js on Windows 10 on ARM, add the components "Visual C++ compilers and libraries for ARM64" and "Visual C++ ATL for ARM64".
-The following is a short summary of the basic usage of the connector, the full api and documentation can be found here
-To use the connector, first require the library td-connector
. Running the function taos.connect
with the connection options passed in as an object will return a TDengine connection object. The required connection option is host
, other options if not set, will be the default values as shown below.
A cursor also needs to be initialized in order to interact with TDengine from Node.js.
const taos = require('td-connector');
@@ -259,7 +259,7 @@ var conn = taos.connect({host:"127.0.0.1", user:"root", password:"taosdata", con
var cursor = conn.cursor(); // Initializing a new cursor
To close a connection, run
conn.close();
-We can now start executing simple queries through the cursor.query
function, which returns a TaosQuery object.
var query = cursor.query('show databases;')
We can get the results of the queries through the query.execute()
function, which returns a promise that resolves with a TaosResult object, which contains the raw data and additional functionalities such as pretty printing the results.
Coming soon
-An example of using the NodeJS connector to create a table with weather data and create and execute queries can be found here (The preferred method for using the connector)
An example of using the NodeJS connector to achieve the same things but without all the object wrappers that wrap around the data returned to achieve higher functionality can be found here
Back