Skip to content

Commit 8457b00

Browse files
author
Georg Traar
committed
Readme improvements
1 parent 04eef5e commit 8457b00

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

README.md

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
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] **This library is primarily a proof of concept.**
99
> While it provides basic functionality to interact with CrateDB, it is not production-ready and lacks the robustness of established libraries.
1010
>
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:
11+
> For production use, consider mature libraries like [`node-postgres`](https://node-postgres.com/) which leverage CrateDB's PostgreSQL compatibility.
1212
1313
## Installation
1414

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

30+
For a local CrateDB Instance:
31+
3032
```javascript
3133
import { CrateDBClient } from '@proddata/node-cratedb';
3234

33-
//for local CrateDB instance
3435
const client = new CrateDBClient();
3536
```
3637

38+
For a remote CrateDB Instance:
39+
3740
```javascript
3841
import { CrateDBClient } from '@proddata/node-cratedb';
3942

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

113116
```js
114-
await client.execute('SELECT ?;', [['Hello'], ['World']]);
117+
await client.execute('INSERT INTO my_table VALUES(?);', [['Hello'], ['World']]);
115118
```
116119

117120
#### streamQuery(sql, batchSize)
@@ -257,21 +260,17 @@ await cursor.close();
257260
This library leverages modern JavaScript features — such as `JSON.rawJSON()` -
258261
to accurately serialize and deserialize `BigInt` values.
259262

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.
263+
- **Serialization**
264+
- **BigInt to LONG:**
265+
When serializing, JavaScript `BigInt` values their precision is preserved.
266+
e.g. `BigInt(12345678901234567890)` is serialized as `12345678901234567890`.
267+
- **Deserialization**
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+
- **Large Integer Values:**
272+
If type information is unavailable, integers exceeding `Number.MAX_SAFE_INTEGER`
273+
and without a decimal point are converted to `BigInt` on a best-effort basis.
275274

276275
## License
277276

0 commit comments

Comments
 (0)