Skip to content

Commit 2de4ef6

Browse files
author
Georg Traar
committed
Readme improvements
1 parent 04eef5e commit 2de4ef6

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

README.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55

66
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.
77

8-
> [!CAUTION] > **This library is primarily a proof of concept.**
8+
> [!CAUTION]
99
> While it provides basic functionality to interact with CrateDB, it is not production-ready and lacks the robustness of established libraries.
10-
>
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:
10+
> For production use, consider mature libraries like [`node-postgres`](https://node-postgres.com/) which leverage CrateDB's PostgreSQL compatibility.
1211
1312
## Installation
1413

@@ -27,13 +26,16 @@ To use the `CrateDBClient`:
2726
2. Instantiate it with your configuration options.
2827
3. Call any of the CRUD and DDL methods provided.
2928

29+
For a local CrateDB Instance:
30+
3031
```javascript
3132
import { CrateDBClient } from '@proddata/node-cratedb';
3233

33-
//for local CrateDB instance
3434
const client = new CrateDBClient();
3535
```
3636

37+
For a remote CrateDB Instance:
38+
3739
```javascript
3840
import { CrateDBClient } from '@proddata/node-cratedb';
3941

@@ -111,7 +113,7 @@ await client.execute('SELECT ?;', ['Hello World!']);
111113
Execute a raw bulk SQL query.
112114

113115
```js
114-
await client.execute('SELECT ?;', [['Hello'], ['World']]);
116+
await client.execute('INSERT INTO my_table VALUES(?);', [['Hello'], ['World']]);
115117
```
116118

117119
#### streamQuery(sql, batchSize)
@@ -257,21 +259,17 @@ await cursor.close();
257259
This library leverages modern JavaScript features — such as `JSON.rawJSON()` -
258260
to accurately serialize and deserialize `BigInt` values.
259261

260-
### Serialization
261-
262-
- **BigInt to LONG:**
263-
When serializing, JavaScript `BigInt` values their precision is preserved.
264-
e.g. `BigInt(12345678901234567890)` is serialized as `12345678901234567890`.
265-
266-
### Deserialization
267-
268-
- **Top-Level LONG Columns:**
269-
If type information is available in the result set, columns defined as CrateDB
270-
`LONG` are automatically converted to `BigInt`.
271-
272-
- **Large Integer Values:**
273-
If type information is unavailable, integers exceeding `Number.MAX_SAFE_INTEGER`
274-
and without a decimal point are converted to `BigInt` on a best-effort basis.
262+
- **Serialization**
263+
- **BigInt to LONG:**
264+
When serializing, JavaScript `BigInt` values their precision is preserved.
265+
e.g. `BigInt(12345678901234567890)` is serialized as `12345678901234567890`.
266+
- **Deserialization**
267+
- **Top-Level LONG Columns:**
268+
If type information is available in the result set, columns defined as CrateDB
269+
`LONG` are automatically converted to `BigInt`.
270+
- **Large Integer Values:**
271+
If type information is unavailable, integers exceeding `Number.MAX_SAFE_INTEGER`
272+
and without a decimal point are converted to `BigInt` on a best-effort basis.
275273

276274
## License
277275

0 commit comments

Comments
 (0)