ead3496cdf
Replace JsonZstdFileSource with ProtobufZstdFileSource across all 20 DevEtl pipeline files. This removes the need for manually defined JsonColumnSchema arrays as protobuf files embed their schema. Changes per file: - Remove using JdeScoping.DataSync.Dev.Models - Remove private JsonColumnSchema[] Schema array - Change CacheFileName from .json.zstd to .pb.zstd - Change WithSource from JsonZstdFileSource to ProtobufZstdFileSource
30 lines
1.1 KiB
C#
30 lines
1.1 KiB
C#
using JdeScoping.DataAccess.Interfaces;
|
|
using JdeScoping.DataSync.Etl.Destinations;
|
|
using JdeScoping.DataSync.Etl.Pipeline;
|
|
using JdeScoping.DataSync.Dev.Sources;
|
|
|
|
namespace JdeScoping.DataSync.Dev;
|
|
|
|
/// <summary>
|
|
/// Development ETL pipeline for the FunctionCode table.
|
|
/// </summary>
|
|
public static class FunctionCodeDevEtl
|
|
{
|
|
public static readonly string TableName = "FunctionCode";
|
|
public static readonly string CacheFileName = "functioncode.pb.zstd";
|
|
|
|
public static EtlPipeline Create(IDbConnectionFactory connectionFactory, string cacheFilePath)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(connectionFactory);
|
|
|
|
if (string.IsNullOrWhiteSpace(cacheFilePath))
|
|
throw new ArgumentException("Cache file path is required.", nameof(cacheFilePath));
|
|
|
|
return new EtlPipelineBuilder()
|
|
.WithName($"{TableName}_Dev")
|
|
.WithSource(new ProtobufZstdFileSource(cacheFilePath))
|
|
.WithDestination(new DbBulkImportDestination(connectionFactory, TableName))
|
|
.Build();
|
|
}
|
|
}
|