Skip to content

Commit afb1569

Browse files
committed
[ksqlDB.RestApi.Client]: model builder doc improvements
1 parent 4ef2aee commit afb1569

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

docs/modelbuilder.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ CREATE TABLE IF NOT EXISTS Payments (
8787
) WITH ( KAFKA_TOPIC='Payment', VALUE_FORMAT='Json', PARTITIONS='3' );
8888
```
8989

90-
The `Secret` column was excluded from the generated DDL statement due to its configuration using the model builder's 'Ignore' method:
90+
The `Secret` column was excluded from the generated DDL statement due to its configuration using the model builder's `Ignore` method:
9191

9292
```SQL
9393
CREATE TABLE IF NOT EXISTS Accounts (
@@ -147,7 +147,7 @@ modelBuilder.AddConvention(decimalTypeConvention);
147147
### WithHeader
148148
**v5.1.0**
149149

150-
Properties of en entity can be marked as a [HEADER](https://docs.ksqldb.io/en/latest/reference/sql/data-definition/#headers) with the model builder's FLUENT API as demonstrated below:
150+
Properties of en entity can be marked as a [HEADER](https://docs.ksqldb.io/en/latest/reference/sql/data-definition/#headers) with the model builder's fluent API as demonstrated below:
151151

152152
```C#
153153
using ksqlDb.RestApi.Client.FluentAPI.Builders;
@@ -176,12 +176,12 @@ CREATE STREAM IF NOT EXISTS PocoWithHeaders (
176176
) WITH ( KAFKA_TOPIC='PocoWithHeader', VALUE_FORMAT='Json', PARTITIONS='1', REPLICAS='3' );
177177
```
178178

179-
The `WithHeader` function within the FLUENT API takes precedence over the `HeadersAttribute`.
179+
The `WithHeader` function within the fluent API takes precedence over the `HeadersAttribute`.
180180

181181
### WithHeaders
182182
**v5.1.0**
183183

184-
Properties of en entity can be marked as a [HEADERS](https://docs.ksqldb.io/en/latest/reference/sql/data-definition/#headers) with the model builder's FLUENT API as demonstrated below:
184+
Properties of en entity can be marked as a [HEADERS](https://docs.ksqldb.io/en/latest/reference/sql/data-definition/#headers) with the model builder's fluent API as demonstrated below:
185185

186186
```C#
187187
using ksqlDb.RestApi.Client.Metadata;
@@ -222,13 +222,14 @@ CREATE STREAM Movie (
222222
) WITH ( KAFKA_TOPIC='MyMovie', VALUE_FORMAT='Json', PARTITIONS='1', REPLICAS='1' );
223223
```
224224

225-
The `WithHeaders` function within the FLUENT API takes precedence over the `HeadersAttribute`.
225+
The `WithHeaders` function within the fluent API takes precedence over the `HeadersAttribute`.
226226

227227
### HasColumnName
228228
**v6.1.0**
229+
229230
The `HasColumnName` function is employed during JSON deserialization and code generation, particularly in tasks like crafting CREATE STREAM or INSERT INTO statements.
230231

231-
The below code demonstrates how to use the `HasColumnName` method in the Fluent API to override the property name `Description` to `Desc` during code generation:
232+
The below code demonstrates how to use the `HasColumnName` method in the fluent API to override the property name `Description` to `Desc` during code generation:
232233

233234
```C#
234235
using ksqlDB.RestApi.Client.KSql.RestApi.Enums;
@@ -237,11 +238,13 @@ modelBuilder.Entity<Payment>()
237238
.Property(b => b.Description)
238239
.HasColumnName("Desc");
239240

240-
var statement = new CreateInsert(modelBuilder).Generate(movie, new InsertProperties { IdentifierEscaping = IdentifierEscaping.Keywords });
241+
var statement = new CreateInsert(modelBuilder)
242+
.Generate(movie, new InsertProperties { IdentifierEscaping = IdentifierEscaping.Keywords });
241243
```
242244

243-
The KSQL snippet illustrates an example INSERT statement with the overridden column names, showing how it corresponds to the Fluent API configuration:
245+
The KSQL snippet illustrates an example INSERT statement with the overridden column name, showing how it corresponds to the fluent API configuration:
244246

245247
```SQL
246-
INSERT INTO Payments (Id, Amount, Desc) VALUES ('1', 33, 'Purchase');
248+
INSERT INTO Payments (Id, Amount, Desc)
249+
VALUES ('1', 33, 'Purchase');
247250
```

0 commit comments

Comments
 (0)