namespace Admin.NET.Plugin.AiDOP.DataPlatform.Core.Connectors;
/// Trusted host plugin. Dialect, identifier quoting, type mapping and ordered
/// parameterized reads belong to the driver. Resolve the secret only within the supplied binding.
public interface IRelationalSourceDriver
{
string ConnectorId { get; }
string ConnectorVersion { get; }
Task OpenReadOnlyAsync(
ConnectorExecution execution, string secretRef, CancellationToken cancellationToken);
}
/// One source connection. Probe the effective permissions and ordering capabilities
/// of this connection. An unverifiable permission or capability must be reported as false.
public interface IRelationalReadSession : IAsyncDisposable
{
Task ProbeAsync(CancellationToken cancellationToken);
/// Read at most BatchSize rows after the supplied committed position, using the
/// authorized dataset mapping. A nonempty page transfers ownership of its payload to the caller
/// (valid after disposal of the session). Return null at end of input. Reading never commits a position.
Task ReadPageAsync(ConnectorReadRequest request, CancellationToken cancellationToken);
}
public sealed record RelationalReadCapabilities(bool ReadOnly, bool Full, bool Incremental)
{
public string? Reason { get; init; }
}
public sealed record RelationalReadBatch(ConnectorFrozenBatch Batch, bool HasMore);