@bzync/nextsql 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/client-encryption.js +634 -0
- package/nextsql.d.ts +335 -0
- package/nextsql.js +2187 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bzync Software Development Services
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# @bzync/nextsql
|
|
2
|
+
|
|
3
|
+
Official [NextSQL](https://nextsql.bzync.com) driver for Node.js. Speaks the native
|
|
4
|
+
NSQL v1 wire protocol over TLS 1.3. Zero runtime dependencies. Bundled
|
|
5
|
+
TypeScript types.
|
|
6
|
+
|
|
7
|
+
Encryption keys and passwords are **never** accepted in a connection URL.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i @bzync/nextsql
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { connect } from "@bzync/nextsql";
|
|
15
|
+
|
|
16
|
+
const conn = await connect({
|
|
17
|
+
address: "db.example.com:7210",
|
|
18
|
+
database: "production",
|
|
19
|
+
user: "app",
|
|
20
|
+
password: process.env.NEXTSQL_DATABASE_PASS,
|
|
21
|
+
tls: { ca, servername: "db.example.com" },
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const res = await conn.exec("SELECT id, name FROM users WHERE id = $1", [1]);
|
|
25
|
+
console.log(res.rows);
|
|
26
|
+
await conn.close();
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Plaintext connections are allowed only on loopback (`insecureNoTLS: true`).
|
|
30
|
+
For an HA cluster with follower-read routing, use `connectCluster`.
|
|
31
|
+
|
|
32
|
+
- Full driver docs: <https://nextsql.bzync.com/docs/drivers>
|
|
33
|
+
- Wire protocol: <https://github.com/bzync/nextsql/blob/master/docs/protocol.md>
|
|
34
|
+
- Client-side field encryption: <https://nextsql.bzync.com/docs/client-encryption>
|
|
35
|
+
|
|
36
|
+
MIT licensed.
|