Class EtlPipelineJsonSinkExtensions

Namespace
Wolfgang.Etl.Json
Assembly
Wolfgang.Etl.Json.dll

Class-named JSON sink terminators for the fluent Wolfgang.Etl.Abstractions.EtlPipeline chain. Each terminator constructs the matching loader and terminates the pipeline, enabling … .JsonLineLoader<Person>("people.jsonl").

public static class EtlPipelineJsonSinkExtensions
Inheritance
EtlPipelineJsonSinkExtensions
Inherited Members

Remarks

Path-based terminators own the file stream they create and dispose it after the run completes (success or failure). Stream-based terminators do not dispose — the caller owns the stream.

Methods

JsonLineLoader<T>(IEtlPipeline<T>, Stream, JsonSerializerOptions?)

Terminates the pipeline, writing each record as a line of JSONL to a stream. The caller owns the stream.

[RequiresUnreferencedCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
[RequiresDynamicCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
public static IEtlPipelineSink JsonLineLoader<T>(this IEtlPipeline<T> pipeline, Stream stream, JsonSerializerOptions? options = null) where T : notnull

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

stream Stream

The stream to write JSONL to.

options JsonSerializerOptions

Optional serializer options.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or stream is null.

JsonLineLoader<T>(IEtlPipeline<T>, string, JsonSerializerOptions?)

Terminates the pipeline, writing each record as a line of JSONL to a file.

[RequiresUnreferencedCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
[RequiresDynamicCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
public static IEtlPipelineSink JsonLineLoader<T>(this IEtlPipeline<T> pipeline, string path, JsonSerializerOptions? options = null) where T : notnull

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

path string

The path of the JSONL file to write.

options JsonSerializerOptions

Optional serializer options.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or path is null.

JsonSingleStreamLoader<T>(IEtlPipeline<T>, Stream, JsonSerializerOptions?)

Terminates the pipeline, writing all records as a single JSON array to a stream. The caller owns the stream.

[RequiresUnreferencedCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
[RequiresDynamicCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
public static IEtlPipelineSink JsonSingleStreamLoader<T>(this IEtlPipeline<T> pipeline, Stream stream, JsonSerializerOptions? options = null) where T : notnull

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

stream Stream

The stream to write the JSON array to.

options JsonSerializerOptions

Optional serializer options.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or stream is null.

JsonSingleStreamLoader<T>(IEtlPipeline<T>, string, JsonSerializerOptions?)

Terminates the pipeline, writing all records as a single JSON array to a file.

[RequiresUnreferencedCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
[RequiresDynamicCode("JSON serialization of unknown types may require types that cannot be statically analyzed.")]
public static IEtlPipelineSink JsonSingleStreamLoader<T>(this IEtlPipeline<T> pipeline, string path, JsonSerializerOptions? options = null) where T : notnull

Parameters

pipeline IEtlPipeline<T>

The pipeline to terminate.

path string

The path of the JSON array file to write.

options JsonSerializerOptions

Optional serializer options.

Returns

IEtlPipelineSink

A runnable Wolfgang.Etl.Abstractions.IEtlPipelineSink.

Type Parameters

T

The record type to serialize.

Exceptions

ArgumentNullException

pipeline or path is null.