tomasfabian / ksqlDB.RestApi.Client-DotNet

ksqlDb.RestApi.Client is a C# LINQ-enabled client API for issuing and consuming ksqlDB push and pull queries and executing statements.
MIT License
93 stars 24 forks source link

Add support for configuring properties as Headers with the model builder's FLUENT API #74

Closed tomasfabian closed 2 months ago

tomasfabian commented 2 months ago

Add support for marking columns as Headers with the model builder.

The proposed API is as follows:

ModelBuilder modelBuilder = new();

modelBuilder.Entity<Item>()
  .Property(b => b.Description)
  .WithHeaders();
CREATE STREAM item (
    Description ARRAY<STRUCT<key STRING, value BYTES>> HEADERS
) WITH (
    kafka_topic = 's3',
    value_format = 'json'
);

or for a single HEADER the type must be of type []byte:

ModelBuilder modelBuilder = new();

modelBuilder.Entity<Item>()
  .Property(b => b.Description)
  .WithHeader("abc");
CREATE STREAM item (
    Description BYTES HEADER('abc')
) WITH (
    kafka_topic = 's4',
    value_format = 'json'
);
tomasfabian commented 2 months ago

Was released in:

dotnet add package ksqlDb.RestApi.Client --version 5.1.0