@geodedb/client 1.0.0-alpha.2 → 1.0.0-alpha.20
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/README.md +40 -26
- package/dist/index.d.ts +665 -236
- package/dist/index.js +2747 -1535
- package/dist/index.js.map +1 -1
- package/package.json +18 -13
- package/proto/geode.proto +577 -0
- package/dist/index.d.mts +0 -2430
- package/dist/index.mjs +0 -5101
- package/dist/index.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
# Geode Node.js Client
|
|
2
2
|
|
|
3
|
-
A high-performance Node.js client library for the [Geode](https://gitlab.com/devnw/geode) graph database, implementing the ISO/IEC 39075:2024 GQL standard over QUIC
|
|
3
|
+
A high-performance Node.js client library for the [Geode](https://gitlab.com/devnw/geode) graph database, implementing the ISO/IEC 39075:2024 GQL standard over QUIC or gRPC with TLS 1.3.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
7
|
- **Full GQL Support**: Implements ISO/IEC 39075:2024 Graph Query Language standard
|
|
8
|
-
- **
|
|
8
|
+
- **Dual Transport**: QUIC (default) or gRPC transport with TLS 1.3 encryption
|
|
9
|
+
- **Protobuf Wire Protocol**: Efficient binary serialization using Protocol Buffers
|
|
9
10
|
- **Connection Pooling**: Efficient connection management for high-throughput applications
|
|
10
11
|
- **Type Safety**: Full TypeScript support with comprehensive type definitions
|
|
11
12
|
- **Query Builder**: Fluent API for building GQL queries programmatically
|
|
12
13
|
- **Transaction Support**: Full transaction management with savepoints
|
|
13
14
|
- **Async/Await**: Modern async API with proper cancellation support
|
|
15
|
+
- **ESM Native**: Pure ESM package for modern Node.js applications
|
|
14
16
|
|
|
15
17
|
## Installation
|
|
16
18
|
|
|
@@ -29,7 +31,7 @@ npm install @geodedb/client
|
|
|
29
31
|
import { createClient } from '@geodedb/client';
|
|
30
32
|
|
|
31
33
|
// Connect to Geode
|
|
32
|
-
const client = await createClient('
|
|
34
|
+
const client = await createClient('quic://localhost:3141');
|
|
33
35
|
|
|
34
36
|
// Execute a query
|
|
35
37
|
const rows = await client.queryAll('MATCH (n:Person) RETURN n.name, n.age');
|
|
@@ -44,8 +46,14 @@ await client.close();
|
|
|
44
46
|
|
|
45
47
|
### DSN Format
|
|
46
48
|
|
|
49
|
+
> **Note**: See [`geode/docs/DSN.md`](../geode/docs/DSN.md) for the complete DSN specification.
|
|
50
|
+
|
|
51
|
+
The client supports multiple transport schemes:
|
|
52
|
+
|
|
47
53
|
```
|
|
48
|
-
|
|
54
|
+
quic://[username:password@]host[:port][?options] # QUIC transport (default port: 3141)
|
|
55
|
+
grpc://[username:password@]host[:port][?options] # gRPC transport (default port: 50051)
|
|
56
|
+
host:port # Simple format (uses QUIC)
|
|
49
57
|
```
|
|
50
58
|
|
|
51
59
|
### Options
|
|
@@ -56,7 +64,8 @@ geode://[username:password@]host[:port][?options]
|
|
|
56
64
|
| `hello_name` | Client name | geode-nodejs |
|
|
57
65
|
| `hello_ver` | Client version | 1.0.0 |
|
|
58
66
|
| `conformance` | GQL conformance level | min |
|
|
59
|
-
| `
|
|
67
|
+
| `tls` | Enable TLS (gRPC only) | true |
|
|
68
|
+
| `insecure_tls_skip_verify` | Skip TLS verification (dev only) | false |
|
|
60
69
|
| `ca` | Path to CA certificate | - |
|
|
61
70
|
| `cert` | Path to client certificate (mTLS) | - |
|
|
62
71
|
| `key` | Path to client key (mTLS) | - |
|
|
@@ -66,33 +75,43 @@ geode://[username:password@]host[:port][?options]
|
|
|
66
75
|
|
|
67
76
|
### Environment Variables
|
|
68
77
|
|
|
69
|
-
| Variable
|
|
70
|
-
|
|
|
71
|
-
| `GEODE_HOST`
|
|
72
|
-
| `GEODE_PORT`
|
|
73
|
-
| `
|
|
74
|
-
| `
|
|
75
|
-
| `
|
|
78
|
+
| Variable | Description |
|
|
79
|
+
| ----------------- | ------------------------------ |
|
|
80
|
+
| `GEODE_HOST` | Default host |
|
|
81
|
+
| `GEODE_PORT` | Default port |
|
|
82
|
+
| `GEODE_TRANSPORT` | Default transport (quic/grpc) |
|
|
83
|
+
| `GEODE_TLS_CA` | Default CA certificate path |
|
|
84
|
+
| `GEODE_USERNAME` | Default username |
|
|
85
|
+
| `GEODE_PASSWORD` | Default password |
|
|
76
86
|
|
|
77
87
|
### Example Configurations
|
|
78
88
|
|
|
79
89
|
```typescript
|
|
80
|
-
// Simple connection
|
|
90
|
+
// Simple QUIC connection (default)
|
|
81
91
|
const client = await createClient('localhost:3141');
|
|
82
92
|
|
|
93
|
+
// Explicit QUIC transport
|
|
94
|
+
const client = await createClient('quic://localhost:3141');
|
|
95
|
+
|
|
96
|
+
// gRPC transport
|
|
97
|
+
const client = await createClient('grpc://localhost:50051');
|
|
98
|
+
|
|
99
|
+
// gRPC without TLS (development only)
|
|
100
|
+
const client = await createClient('grpc://localhost:50051?tls=0');
|
|
101
|
+
|
|
83
102
|
// With authentication
|
|
84
|
-
const client = await createClient('
|
|
103
|
+
const client = await createClient('quic://admin:secret@localhost:3141');
|
|
85
104
|
|
|
86
|
-
// With TLS
|
|
87
|
-
const client = await createClient('
|
|
105
|
+
// With TLS CA certificate
|
|
106
|
+
const client = await createClient('quic://localhost:3141?ca=/path/to/ca.crt');
|
|
88
107
|
|
|
89
108
|
// With mTLS
|
|
90
109
|
const client = await createClient(
|
|
91
|
-
'
|
|
110
|
+
'quic://localhost:3141?ca=/path/to/ca.crt&cert=/path/to/client.crt&key=/path/to/client.key'
|
|
92
111
|
);
|
|
93
112
|
|
|
94
113
|
// With connection pool
|
|
95
|
-
const client = await createClient('
|
|
114
|
+
const client = await createClient('quic://localhost:3141', {
|
|
96
115
|
pooling: true,
|
|
97
116
|
pool: {
|
|
98
117
|
min: 2,
|
|
@@ -458,7 +477,7 @@ try {
|
|
|
458
477
|
## Connection Pool
|
|
459
478
|
|
|
460
479
|
```typescript
|
|
461
|
-
const client = await createClient('
|
|
480
|
+
const client = await createClient('quic://localhost:3141', {
|
|
462
481
|
pooling: true,
|
|
463
482
|
pool: {
|
|
464
483
|
min: 2, // Minimum connections to maintain
|
|
@@ -572,18 +591,13 @@ npm run test:integration
|
|
|
572
591
|
|
|
573
592
|
See [CLAUDE.md](./CLAUDE.md) for development guidelines.
|
|
574
593
|
|
|
594
|
+
### Development Setup
|
|
595
|
+
|
|
575
596
|
```bash
|
|
576
|
-
# Clone repository
|
|
577
597
|
git clone https://gitlab.com/devnw/geode/geode-client-nodejs.git
|
|
578
598
|
cd geode-client-nodejs
|
|
579
|
-
|
|
580
|
-
# Install dependencies
|
|
581
599
|
npm install
|
|
582
|
-
|
|
583
|
-
# Run tests
|
|
584
600
|
npm test
|
|
585
|
-
|
|
586
|
-
# Build
|
|
587
601
|
npm run build
|
|
588
602
|
```
|
|
589
603
|
|