Skip to content

Commit 5b99649

Browse files
authored
docs: updates for ILP/HTTP version 2.0.0 (#20)
1 parent 67bd37b commit 5b99649

File tree

20 files changed

+181
-358
lines changed

20 files changed

+181
-358
lines changed

README.md

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
- [Getting started](#getting-started)
1616
- [Usage](#usage)
17-
- [Construction parameters](#construction-parameters)
17+
- [Configuration parameters](#configuration-parameters)
1818
- [Properties and methods](#properties-and-methods)
1919
- [Examples](#examples)
2020
- [FAQ](#faq-)
@@ -33,26 +33,27 @@ See: [https://www.nuget.org/packages/net-questdb-client/](https://www.nuget.org/
3333

3434
`Sender` is single-threaded, and uses a single connection to the database.
3535

36-
If you want to send in parallel, you can use multiple senders and standard async functionality
37-
to wait in parallel.
36+
If you want to send in parallel, you can use multiple senders and standard async tasking.
37+
38+
See more in-depth documentation [here](https://questdb.io/docs/clients/ingest-dotnet/).
3839

3940
### Basic usage
4041

41-
```c#
42+
```csharp
4243
using var sender = Sender.New("http::addr=localhost:9000;");
43-
sender.Table("metric_name")
44+
await sender.Table("metric_name")
4445
.Symbol("Symbol", "value")
4546
.Column("number", 10)
4647
.Column("double", 12.23)
4748
.Column("string", "born to shine")
48-
.At(new DateTime(2021, 11, 25, 0, 46, 26));
49+
.AtAsync(new DateTime(2021, 11, 25, 0, 46, 26));
4950
await sender.SendAsync();
5051
```
5152

5253
### Multi-line send (sync)
5354

54-
```c#
55-
using var sender = Sender.New("http::addr=localhost:9000;");
55+
```csharp
56+
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=off;");
5657
for(int i = 0; i < 100; i++)
5758
{
5859
sender.Table("metric_name")
@@ -70,7 +71,7 @@ Alternatively, it will flush every 1000ms.
7071

7172
This is equivalent to a config string of:
7273

73-
```c#
74+
```csharp
7475
using var sender = Sender.New("http:addr=localhost:9000;auto_flush=on;auto_flush_rows=75000;auto_flush_interval=1000;");
7576
```
7677

@@ -79,45 +80,45 @@ the sender is disposed.
7980

8081
#### Flush every 1000 rows or every 1 second
8182

82-
```c#
83+
```csharp
8384
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=1000;");
8485
```
8586

8687
#### Flush every 5000 rows
8788

88-
```c#
89-
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=1000;auto_flush_interval=-1;");
89+
```csharp
90+
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=1000;auto_flush_interval=off;");
9091
```
9192

9293
#### Flush after 5 seconds
9394

94-
```c#
95-
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_interval=5000;");
95+
```csharp
96+
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=off;auto_flush_interval=5000;");
9697
```
9798

9899
#### Flush only when buffer is 4kb
99100

100-
```c#
101-
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_bytes=4096;auto_flush_rows=-1;auto_flush_interval=-1");
101+
```csharp
102+
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_bytes=4096;auto_flush_rows=off;auto_flush_interval=off;");
102103
```
103104

104105
### Authenticated
105106

106107
#### HTTP Authentication (Basic)
107108

108-
```c#
109+
```csharp
109110
using var sender = Sender.New("https::addr=localhost:9009;tls_verify=unsafe_off;username=admin;password=quest;");;
110111
```
111112

112113
#### HTTP Authentication (Token)
113114

114-
```c#
115+
```csharp
115116
using var sender = Sender.New("https::addr=localhost:9009;tls_verify=unsafe_off;username=admin;token=<bearer token>");;
116117
```
117118

118119
#### TCP Authentication
119120

120-
```c#
121+
```csharp
121122
using var sender = Sender.New("tcps::addr=localhost:9009;tls_verify=unsafe_off;username=admin;token=NgdiOWDoQNUP18WOnb1xkkEG5TzPYMda5SiUOvT1K0U=;");
122123
```
123124

@@ -165,22 +166,27 @@ The config string format is:
165166

166167
## Properties and methods
167168

168-
| Name | Returns | Description |
169-
|-------------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------------------------------|
170-
| `Length` | `int` | Current length in bytes of the buffer (not capacity!) |
171-
| `RowCount` | `int` | Current row count of the buffer |
172-
| `WithinTransaction` | `bool` | Whether or not the Sender is currently in a transactional state. |
173-
| `Transaction(ReadOnlySpan<char>)` | `ISender` | Starts a new transaction for the table. |
174-
| `Commit() / CommitAsync()` | `Ibool` | Commits the current transaction. |
175-
| `Table(ReadOnlySpan<char>)` | | |
176-
| `Column(ReadOnlySpan<char>, ReadOnlySpan<char> / string / long / double / DateTime / DateTimeOffset)` | `ISender` | Specify column name and value |
177-
| `Column(ReadOnlySpan<char>, string? / long? / double? / DateTime? / DateTimeOffset?)` | `ISender` | |
178-
| `Symbol(ReadOnlySpan<char>, ReadOnlySpan<char> / string)` | `ISender` | |
179-
| `At(DateTime / DateTimeOffset / long)` | | Designated timestamp for the line. For long, this is in unix nanoseconds. |
180-
| `AtNow()` | | Finishes line, leaving QuestDB server to set the timestamp |
181-
| `Send() / SendAsync()` | | Send IO Buffers to QuestDB |
182-
| `CancelRow()` | | Cancels current row. |
183-
| `Truncate()` | | Trims empty buffers. |
169+
| Name | Returns | Description |
170+
|-------------------------------------------------------------------------------------------------------|-----------------|----------------------------------------------------------------------------|
171+
| `Length` | `int` | Current length in bytes of the buffer (not capacity!) |
172+
| `RowCount` | `int` | Current row count of the buffer |
173+
| `LastFlush` | `DateTime` | Returns the UTC DateTime of the last flush sending data to the server. |
174+
| `WithinTransaction` | `bool` | Whether or not the Sender is currently in a transactional state. |
175+
| `Transaction(ReadOnlySpan<char>)` | `ISender` | Starts a new transaction for the table. |
176+
| `Commit() / CommitAsync()` | `void` / `Task` | Commits the current transaction. |
177+
| `Rollback()` | `void` | Rolls back the current unsent transaction. |
178+
| `Table(ReadOnlySpan<char>)` | `ISender` | Sets the table name for the next row. |
179+
| `Column(ReadOnlySpan<char>, ReadOnlySpan<char> / string / long / double / DateTime / DateTimeOffset)` | `ISender` | Specify column name and value |
180+
| `Column(ReadOnlySpan<char>, string? / long? / double? / DateTime? / DateTimeOffset?)` | `ISender` | Specify column name and value |
181+
| `Symbol(ReadOnlySpan<char>, ReadOnlySpan<char> / string)` | `ISender` | Specify a symbol column name and value |
182+
| `At(DateTime / DateTimeOffset / long, CancellationToken)` | `void` | Designated timestamp for the line. May flush data according to auto-flush. |
183+
| `AtAsync(DateTime / DateTimeOffset / long, CancellationToken)` | `ValueTask` | Designated timestamp for the line. May flush data according to auto-flush. |
184+
| `AtNow(CancellationToken)` | `void` | Finishes line, leaving the QuestDB server to set the timestamp |
185+
| `AtNowAsync(CancellationToken)` | `ValueTask` | Finishes line, leaving the QuestDB server to set the timestamp |
186+
| `Send() / SendAsync()` | `void` / `Task` | Send IO Buffers to QuestDB |
187+
| `CancelRow()` | `void` | Cancels current row. |
188+
| `Truncate()` | `void` | Trims empty buffers. |
189+
| `Clear()` | `void` | Clears the sender's buffer. |
184190

185191
## Examples
186192

@@ -191,12 +197,13 @@ The config string format is:
191197

192198
### Does this client perform both read and write operations?
193199

194-
No. This client is for write only. For querying, see
200+
No. This client is for writing data only. For querying, see
195201
the [Query & SQL overview](https://questdb.io/docs/reference/sql/overview/)
196202

197203
### Where do I report issues with the client?
198204

199-
If something is not working as expected, please open an [issue](https://github.com/questdb/net-questdb-client/issues/new).
205+
If something is not working as expected, please open
206+
an [issue](https://github.com/questdb/net-questdb-client/issues/new).
200207

201208
### Where can I learn more about QuestDB?
202209

docfx.json

Lines changed: 0 additions & 54 deletions
This file was deleted.

docs/conf.md

Whitespace-only changes.

docs/getting-started.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/install.md

Whitespace-only changes.

docs/introduction.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/sender.md

Whitespace-only changes.

docs/toc.yml

Lines changed: 0 additions & 4 deletions
This file was deleted.

images/banner.svg

Lines changed: 0 additions & 38 deletions
This file was deleted.

images/favicon.ico

-16.6 KB
Binary file not shown.

images/logo.png

-1.15 KB
Binary file not shown.

index.md

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/example-streaming/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
var rowsToSend = 1e6;
55

6-
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=10;auto_flush_interval=off;");
6+
using var sender = Sender.New("http::addr=localhost:9000;auto_flush=on;auto_flush_rows=75000;auto_flush_interval=off;");
77

88
var timer = new Stopwatch();
99
timer.Start();

0 commit comments

Comments
 (0)