You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+50-36Lines changed: 50 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,11 @@
5
5
6
6
This library is a lightweight Node.js client derived from `node-crate` for interacting with CrateDB via its **HTTP endpoint**. Unlike libraries such as `node-postgres`, which use the PostgreSQL wire protocol, this client communicates with CrateDB's native HTTP API.
7
7
8
-
> [!CAUTION]
9
-
> **This library is primarily a proof of concept.**
10
-
> While it provides basic functionality to interact with CrateDB, it is not production-ready and lacks the robustness of established libraries.
11
-
>
8
+
> [!CAUTION] > **This library is primarily a proof of concept.**
9
+
> While it provides basic functionality to interact with CrateDB, it is not production-ready and lacks the robustness of established libraries.
10
+
>
12
11
> For production use, consider mature libraries like [`node-postgres`](https://node-postgres.com/) which leverage CrateDB's PostgreSQL compatibility. Use this client only for **testing, experimentation**, or if you know what you're doing. :wink:
13
12
14
-
15
13
## Installation
16
14
17
15
To install `node-cratedb` using npm:
@@ -44,10 +42,10 @@ const client = new CrateDBClient({
44
42
password:'secretpassword!!',
45
43
host:'my.database-server.com',
46
44
port:4200,
47
-
ssl:true, // Use HTTPS
48
-
keepAlive:true, // Enable persistent connections
49
-
maxConnections:20, // Limit to 10 concurrent sockets
50
-
defaultSchema:'my_schema'// Default schema for queries
45
+
ssl:true, // Use HTTPS
46
+
keepAlive:true, // Enable persistent connections
47
+
maxConnections:20, // Limit to 10 concurrent sockets
48
+
defaultSchema:'my_schema',// Default schema for queries
51
49
});
52
50
```
53
51
@@ -58,29 +56,28 @@ import { CrateDBClient } from '@proddata/node-cratedb';
58
56
59
57
constclient=newCrateDBClient({
60
58
host:'my.database-server.com',
61
-
jwt:'your.jwt.token.here', // Use JWT for Bearer authentication
62
-
ssl:true
59
+
jwt:'your.jwt.token.here', // Use JWT for Bearer authentication
60
+
ssl:true,
63
61
});
64
62
```
65
63
66
-
67
64
### Configuration
68
65
69
66
The `CrateDBClient` can be configured with either environment variables or directly with an options object. Below are the configuration options, along with their default values.
0 commit comments