Skip to content

Commit ff3dffa

Browse files
committed
refactor: remove native bindings support
- Removed the `gaussdb.native` interface and all native-specific code. - Simplified the test suite to only run against the JS implementation. - Updated docs about `pg-native`. BREAKING CHANGE: The `gaussdb.native` interface has been removed.
1 parent 6363fb9 commit ff3dffa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+140
-3077
lines changed

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
<span class="badge-npmversion"><a href="https://npmjs.org/package/gaussdb" title="View this project on NPM"><img src="https://img.shields.io/npm/v/gaussdb.svg" alt="NPM version" /></a></span>
66
<span class="badge-npmdownloads"><a href="https://npmjs.org/package/gaussdb" title="View this project on NPM"><img src="https://img.shields.io/npm/dm/gaussdb.svg" alt="NPM downloads" /></a></span> -->
77

8-
Non-blocking GaussDB client for Node.js. Pure JavaScript and optional native libpq bindings.
8+
Non-blocking GaussDB client for Node.js.
99

1010
## Monorepo
1111

1212
This repo is a monorepo which contains the core [gaussdb](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb) module as well as a handful of related modules.
1313

1414
- [gaussdb](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb)
1515
- [gaussdb-pool](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb-pool)
16-
- [pg-native](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/pg-native)
1716
- [gaussdb-cursor](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb-cursor)
1817
- [gaussdb-query-stream](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb-query-stream)
1918
- [gaussdb-connection-string](https://github.com/HuaweiCloudDeveloper/gaussdb-node/tree/master/packages/gaussdb-connection-string)
@@ -37,7 +36,6 @@ The source repo for the documentation is available for contribution [here](https
3736

3837
### Features
3938

40-
- Pure JavaScript client and native libpq bindings share _the same API_
4139
- Connection pooling
4240
- Extensible JS ↔ GaussDB data-type coercion
4341
- Supported GaussDB features
@@ -77,11 +75,10 @@ If your change involves breaking backwards compatibility please please point tha
7775
### Setting up for local development
7876

7977
1. Clone the repo
80-
2. Ensure you have installed libpq-dev in your system.
81-
3. From your workspace root run `yarn` and then `yarn lerna bootstrap`
82-
4. Ensure you have a GaussDB instance running with SSL enabled and an empty database for tests
83-
5. Ensure you have the proper environment variables configured for connecting to the instance
84-
6. Run `yarn test` to run all the tests
78+
2. From your workspace root run `yarn` and then `yarn lerna bootstrap`
79+
3. Ensure you have a GaussDB instance running with SSL enabled and an empty database for tests
80+
4. Ensure you have the proper environment variables configured for connecting to the instance
81+
5. Run `yarn test` to run all the tests
8582

8683
## License
8784

docs/pages/features/_meta.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"transactions": "Transactions",
66
"types": "Data Types",
77
"ssl": "SSL",
8-
"native": "Native",
98
"esm": "ESM",
109
"callbacks": "Callbacks"
1110
}

docs/pages/features/native.mdx

Lines changed: 0 additions & 29 deletions
This file was deleted.

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@
77
"allowBranch": "master"
88
}
99
},
10-
"ignoreChanges": ["**/*.md", "**/test/**", "packages/pg-native/**", "packages/pg-native-*/**"]
10+
"ignoreChanges": ["**/*.md", "**/test/**"]
1111
}

packages/gaussdb-cursor/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Use a GaussDB result cursor from node with an easy to use API.
88
```sh
99
$ npm install gaussdb-cursor
1010
```
11-
___note___: this depends on _either_ `npm install gaussdb` or `npm install gaussdb.js`, but you __must__ be using the pure JavaScript client. This will __not work__ with the native bindings.
11+
___note___: this depends on _either_ `npm install gaussdb` or `npm install gaussdb.js`, but you __must__ be using the pure JavaScript client.
1212

1313
### :star: Documentation :star:
1414

packages/gaussdb-esm-test/common-js-imports.test.cjs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ const paths = [
77
'gaussdb-node/lib/index.js',
88
'gaussdb-node/lib/connection-parameters.js',
99
'gaussdb-protocol/dist/messages.js',
10-
'pg-native/lib/build-result.js',
1110
]
1211
for (const path of paths) {
1312
describe(`importing ${path}`, () => {
@@ -18,13 +17,3 @@ for (const path of paths) {
1817
})
1918
}
2019

21-
describe('pg-native', () => {
22-
it('should work with commonjs', async () => {
23-
const gaussdb = require('gaussdb-node')
24-
25-
const pool = new gaussdb.native.Pool()
26-
const result = await pool.query('SELECT 1')
27-
assert.strictEqual(result.rowCount, 1)
28-
pool.end()
29-
})
30-
})

packages/gaussdb-esm-test/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
"gaussdb-cursor": "^0.2.0",
1919
"gaussdb-pool": "^0.2.0",
2020
"gaussdb-protocol": "^0.2.0",
21-
"gaussdb-query-stream": "^0.2.0",
22-
"pg-native": "^3.5.0"
21+
"gaussdb-query-stream": "^0.2.0"
2322
},
2423
"author": "Brian M. Carlson <[email protected]>",
2524
"license": "MIT"

packages/gaussdb-esm-test/pg-native.test.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/gaussdb-node/Makefile

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ params := $(connectionString)
66

77
node-command := xargs -n 1 -I file node file $(params)
88

9-
.PHONY : test test-connection test-integration bench test-native \
9+
.PHONY : test test-connection test-integration bench \
1010
publish update-npm
1111

1212
all:
@@ -17,7 +17,7 @@ help:
1717

1818
test: test-unit
1919

20-
test-all: test-unit test-integration test-native test-worker
20+
test-all: test-unit test-integration test-worker
2121

2222

2323
update-npm:
@@ -33,15 +33,6 @@ test-connection:
3333
@echo "***Testing connection***"
3434
@node script/create-test-tables.js $(params)
3535

36-
test-native: test-connection
37-
@echo "***Testing native bindings***"
38-
ifeq ($(TEST_SKIP_NATIVE), true)
39-
@echo "***Skipping tests***"
40-
else
41-
@find test/native -name "*-tests.js" | $(node-command)
42-
@find test/integration -name "*-tests.js" | $(node-command) native
43-
endif
44-
4536
test-integration: test-connection
4637
@echo "***Testing Pure Javascript***"
4738
@find test/integration -name "*-tests.js" | $(node-command)

packages/gaussdb-node/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@
44

55
### Features
66

7-
- Pure JavaScript client and native libpq bindings share _the same API_
87
- Connection pooling
98
- Extensible JS ↔ GaussDB data-type coercion
109

11-
Non-blocking GaussDB client for Node.js. Pure JavaScript and optional native libpq bindings.
10+
Non-blocking GaussDB client for Node.js.
1211

1312
## Install
1413

1514
```sh
16-
$ npm install gaussdb
15+
$ npm install gaussdb-node
1716
```
1817

1918
---
@@ -22,7 +21,6 @@ $ npm install gaussdb
2221

2322
### Features
2423

25-
- Pure JavaScript client and native libpq bindings share _the same API_
2624
- Connection pooling
2725
- Extensible JS ↔ Gaussdb data-type coercion
2826
- Supported Gaussdb features

0 commit comments

Comments
 (0)