Skip to content

Commit de46ee3

Browse files
committed
v4.2.0
1 parent 91e9f0b commit de46ee3

28 files changed

+351
-176
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ run().then(console.log).catch(console.error);
314314

315315
### Decimal usage example
316316

317-
Since v9.2.0, QuestDB supports the DECIMAL data type.
317+
Since v9.2.0, QuestDB supports the `DECIMAL` data type.
318318
Decimals can be ingested with ILP protocol v3 using either textual or binary representation.
319319

320320
#### Textual representation
@@ -324,12 +324,13 @@ import { Sender } from "@questdb/nodejs-client";
324324

325325
async function runDecimals() {
326326
const sender = await Sender.fromConfig(
327-
"tcp::addr=127.0.0.1:9009;protocol_version=3",
327+
"http::addr=127.0.0.1:9000;protocol_version=3",
328328
);
329329

330330
await sender
331331
.table("fx")
332-
// textual ILP form keeps the literal and its exact scale
332+
// textual form keeps the literal and its exact scale,
333+
// resulting in ILP line: fx mid=1.234500d
333334
.decimalColumnText("mid", "1.234500")
334335
.atNow();
335336

@@ -338,25 +339,25 @@ async function runDecimals() {
338339
}
339340

340341
runDecimals().catch(console.error);
341-
// Resulting ILP line: fx mid=1.234500d
342342
```
343343

344344
#### Binary representation
345345

346-
It is recommended to use the binary representation for better ingestion performance and reduced payload size (for bigger decimals).
346+
It is recommended to use the binary representation for better ingestion performance and reduced payload size (for bigger decimal values).
347347

348348
```typescript
349349
import { Sender } from "@questdb/nodejs-client";
350350

351351
async function runDecimals() {
352352
const sender = await Sender.fromConfig(
353-
"tcp::addr=127.0.0.1:9009;protocol_version=3",
353+
"http::addr=127.0.0.1:9000;protocol_version=3",
354354
);
355355

356356
await sender
357357
.table("fx")
358-
// textual ILP form keeps the literal and its exact scale
359-
.decimalColumn("mid", 123456n, 3) // 123456 * 10^-3 = 123.456
358+
// decimal value is sent in its binary form
359+
// 123.456 = 123456 * 10^-3
360+
.decimalColumn("mid", 123456n, 3)
360361
.atNow();
361362

362363
await sender.flush();

docs/assets/hierarchy.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/navigation.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/assets/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/classes/HttpTransport.html

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

docs/classes/Sender.html

Lines changed: 46 additions & 21 deletions
Large diffs are not rendered by default.

docs/classes/SenderBufferV1.html

Lines changed: 54 additions & 19 deletions
Large diffs are not rendered by default.

docs/classes/SenderBufferV2.html

Lines changed: 54 additions & 19 deletions
Large diffs are not rendered by default.

docs/classes/SenderOptions.html

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

docs/classes/TcpTransport.html

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)