Skip to content

Commit 76cdc34

Browse files
authored
feat: connector supports version matching detection (#81)
* feat: add tdengine version compare * feat: Remove unnecessary dependencies * feat: upgrade related dependencies * feat: modify test ip * feat: modify comments * feat: modify ubuntu version 22.04 * feat: modify actions/checkout@v4 * feat: modify set safe directory * feat: resolve the issue of connect pool release errors * feat: upgrade the ci nodejs version to solve the compatibility issue with the ts-test library version * feat: update node version test * feat: modify log print error * feat: Restore old interface * feat: delete old interface * feat: support subscription of consumer parameters and dynamic addition * feat: fix connection statistics count
1 parent c06e1d8 commit 76cdc34

21 files changed

Lines changed: 809 additions & 1802 deletions

.github/workflows/build.yaml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ on:
1111
jobs:
1212
build:
1313

14-
runs-on: ubuntu-20.04
14+
runs-on: ubuntu-22.04
1515

1616
strategy:
1717
matrix:
18-
node-version: [14.x,16.x]
18+
node-version: [16.x,20.x]
1919
steps:
2020

2121
- name: Build Tools
@@ -25,7 +25,7 @@ jobs:
2525
sudo apt-get install -y python3 python3-pip python-is-python3
2626
2727
- name: Checkout TDengine
28-
uses: actions/checkout@v3
28+
uses: actions/checkout@v4
2929
with:
3030
fetch-depth: 1
3131
repository: 'taosdata/TDengine'
@@ -59,15 +59,22 @@ jobs:
5959
run: |
6060
nohup sudo taosadapter &
6161
62-
- uses: actions/checkout@v3
62+
- name: Checkout current repo
63+
uses: actions/checkout@v4
64+
with:
65+
path: 'nodejs-connector'
66+
clean: true
67+
set-safe-directory: true
68+
69+
6370

6471
- name: Use Node.js ${{ matrix.node-version }}
6572
uses: actions/setup-node@v3
6673
with:
6774
node-version: ${{ matrix.node-version }}
6875

6976
- name: test nodejs websocket
70-
working-directory: nodejs
77+
working-directory: nodejs-connector/nodejs
7178
run: |
7279
ls -al
7380
npm install

nodejs/example/basicSchemaless.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function Prepare() {
1717

1818
await wsSql.exec('create database if not exists power KEEP 3650 DURATION 10 BUFFER 16 WAL_LEVEL 1;');
1919
await wsSql.exec('CREATE STABLE if not exists power.meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupId int);');
20-
wsSql.close();
20+
await wsSql.close();
2121
}
2222

2323
(async () => {
@@ -32,7 +32,6 @@ async function Prepare() {
3232
await wsSchemaless.schemalessInsert([influxdbData], SchemalessProto.InfluxDBLineProtocol, Precision.NANO_SECONDS, 0);
3333
await wsSchemaless.schemalessInsert([telnetData], SchemalessProto.OpenTSDBTelnetLineProtocol, Precision.SECONDS, 0);
3434
await wsSchemaless.schemalessInsert([jsonData], SchemalessProto.OpenTSDBJsonFormatProtocol, Precision.SECONDS, 0);
35-
wsSchemaless.close();
3635
} catch (e) {
3736
console.error(e);
3837
}finally {

nodejs/example/basicSql.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ let dsn = 'ws://root:taosdata@localhost:6041';
4242
let result = wsRows.getData();
4343
console.log('queryRes.Scan().then=>', result);
4444
}
45-
wsRows.close()
45+
await wsRows.close()
4646
}
4747

4848

0 commit comments

Comments
 (0)