Interface IDataProvider

Assembly: redb.Export.dll

Abstracts database-specific operations required by the export/import pipeline.

Each implementation handles connection management, bulk-insert strategy,
constraint toggling, and sequence manipulation for its target RDBMS.

public interface IDataProvider : IAsyncDisposable

Properties

Connection

Returns the underlying instance.

DbConnection Connection { get; }

Name

Short provider identifier (e.g. "postgres", "mssql").

string Name { get; }

Methods

BulkInsertAsync(string, DataTable, CancellationToken)

Performs a bulk insert of the supplied

Task BulkInsertAsync(string tableName, DataTable data, CancellationToken ct = default)

CleanDatabaseAsync(CancellationToken)

Truncates all REDB tables in the correct foreign-key order, leaving the schema intact.

Task CleanDatabaseAsync(CancellationToken ct = default)

DisableConstraintsAsync(CancellationToken)

Disables foreign-key constraints and triggers so that rows can be

Task DisableConstraintsAsync(CancellationToken ct = default)

EnableConstraintsAsync(CancellationToken)

Re-enables foreign-key constraints and triggers after bulk import.

Task EnableConstraintsAsync(CancellationToken ct = default)

GetSequenceValueAsync(CancellationToken)

Returns the current value of the global_identity sequence.

Task<long> GetSequenceValueAsync(CancellationToken ct = default)

OpenAsync(string, CancellationToken)

Opens a connection to the database using the supplied connection string.

Task OpenAsync(string connectionString, CancellationToken ct = default)

SetSequenceValueAsync(long, CancellationToken)

Resets the global_identity sequence to the specified value

Task SetSequenceValueAsync(long value, CancellationToken ct = default)