Skip to content

Commit 9d44a3c

Browse files
Correct insert placement documentation
1 parent 0d48852 commit 9d44a3c

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

‎ClickHouse.Driver/InsertOptions.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ public sealed class InsertOptions : QueryOptions
4646
/// Gets or sets where the <c>INSERT INTO ... FORMAT ...</c> statement is sent. Defaults to
4747
/// <see cref="InsertQueryPlacement.Body"/>, which writes it ahead of the rows in the request body.
4848
/// Set <see cref="InsertQueryPlacement.Url"/> to send it as the <c>query</c> URL parameter instead,
49-
/// so that proxies, gateways and access logs can read it — they cannot see into the body, which
50-
/// <see cref="Compressor"/> compresses by default. The statement then counts towards the URL length,
51-
/// whose effective limit is the lowest imposed by the .NET runtime, an intermediary, and the server.
49+
/// so URL-only routing and logging can read it without decoding and inspecting the request body,
50+
/// which <see cref="Compressor"/> compresses by default. The statement then counts towards the URL
51+
/// length, whose effective limit is the lowest imposed by the .NET runtime, an intermediary, and the server.
5252
/// On .NET 6 through .NET 9, the complete encoded URI cannot exceed 65,519 characters; the driver
5353
/// reports an <see cref="System.InvalidOperationException"/> suggesting <see cref="InsertQueryPlacement.Body"/>
54-
/// if that limit is exceeded. The server's <c>max_uri_size</c> is 1 MiB by default. This setting is
54+
/// if that limit is exceeded. The server's <c>http_max_uri_size</c> is 1 MiB by default. This setting is
5555
/// independent of <see cref="Compressor"/>, which governs the body encoding only.
5656
/// </summary>
5757
public InsertQueryPlacement QueryPlacement { get; init; } = InsertQueryPlacement.Body;

‎ClickHouse.Driver/InsertQueryPlacement.cs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ namespace ClickHouse.Driver;
66
public enum InsertQueryPlacement
77
{
88
/// <summary>
9-
/// The statement is written as the first line of the request body, ahead of the rows. The body
10-
/// carries the whole request, so no part of it is subject to a URL length limit.
9+
/// The statement is written as the first line of the request body, ahead of the rows. The statement
10+
/// and rows are not subject to a URL length limit; other request options can still appear in the URL.
1111
/// </summary>
1212
Body = 0,
1313

1414
/// <summary>
1515
/// The statement is sent as the <c>query</c> URL parameter and the body carries only rows. This
16-
/// makes the statement readable by proxies, gateways and access logs, which cannot see into a
17-
/// compressed body. The effective URL limit is the lowest imposed by the .NET runtime, an
18-
/// intermediary, and the server. On .NET 6 through .NET 9, the complete encoded URI cannot exceed
19-
/// 65,519 characters; the server's <c>max_uri_size</c> is 1 MiB by default.
16+
/// makes the statement available to routing and logging that inspect only the URL, without decoding
17+
/// and inspecting the request body. The effective URL limit is the lowest imposed by the .NET runtime,
18+
/// an intermediary, and the server. On .NET 6 through .NET 9, the complete encoded URI cannot exceed
19+
/// 65,519 characters; the server's <c>http_max_uri_size</c> is 1 MiB by default.
2020
/// </summary>
2121
Url = 1,
2222
}

‎docs/overview.mdx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,14 +511,14 @@ POCO inserts work seamlessly when columns are added to the target table after th
511511

512512
#### Insert query placement {#insert-query-placement}
513513

514-
A binary insert writes its `INSERT INTO ... FORMAT ...` statement as the first line of the request body, ahead of the rows. The body is compressed by default, so an intermediary cannot read the statement there. Set `InsertOptions.QueryPlacement` to `InsertQueryPlacement.Url` to send the statement as the `query` URL parameter instead, leaving the body to the rows alone:
514+
A binary insert writes its `INSERT INTO ... FORMAT ...` statement as the first line of the request body, ahead of the rows. The body is compressed by default, so routing and logging that inspect only the URL do not see the statement. Set `InsertOptions.QueryPlacement` to `InsertQueryPlacement.Url` to send the statement as the `query` URL parameter instead, leaving the body to the rows alone:
515515

516516
```csharp
517517
var options = new InsertOptions { QueryPlacement = InsertQueryPlacement.Url };
518518
await client.InsertBinaryAsync("events", columns, rows, options);
519519
```
520520

521-
Use it when a proxy, load balancer or gateway routes or inspects on the `query` parameter, or when you want the statement in access logs and observability tooling. It is opt-in because the statement then counts towards the URL length. The effective limit is the lowest imposed by the .NET runtime, an intermediary and the server. On .NET 6 through .NET 9, `System.Uri` limits the complete encoded request URI to 65,519 characters; the driver throws an `InvalidOperationException` that directs you back to `InsertQueryPlacement.Body` when this limit is exceeded. ClickHouse's `max_uri_size` is 1 MiB by default, while an intermediary may impose a lower limit. The body has no such limit.
521+
Use it when a proxy, load balancer or gateway routes or inspects on the `query` parameter, or when you want the statement in access logs and observability tooling. It is opt-in because the statement then counts towards the URL length. The effective limit is the lowest imposed by the .NET runtime, an intermediary and the server. On .NET 6 through .NET 9, `System.Uri` limits the complete encoded request URI to 65,519 characters; the driver throws an `InvalidOperationException` that directs you back to `InsertQueryPlacement.Body` when this limit is exceeded. ClickHouse's `http_max_uri_size` is 1 MiB by default, while an intermediary may impose a lower limit. In body mode, the statement and rows have no such URL-length limit; other request options can still appear in the URL.
522522

523523
The setting is independent of `Compressor`: the body is encoded the same way in both modes.
524524

0 commit comments

Comments
 (0)