Class PostgresProvider
implementation for PostgreSQL.
Uses COPY FROM STDIN (TEXT format) for bulk inserts and
session_replication_role = 'replica' to bypass foreign-key triggers
during import.
public sealed class PostgresProvider : IDataProvider, IAsyncDisposable
Inheritance
Implements
Properties
Methods
BulkInsertAsync(string, DataTable, CancellationToken)
Performs a bulk insert of the supplied
public 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.
public Task CleanDatabaseAsync(CancellationToken ct = default)
DisableConstraintsAsync(CancellationToken)
Disables foreign-key constraints and triggers so that rows can be
public Task DisableConstraintsAsync(CancellationToken ct = default)
DisposeAsync()
Performs application-defined tasks associated with freeing, releasing, or
public ValueTask DisposeAsync()
EnableConstraintsAsync(CancellationToken)
Re-enables foreign-key constraints and triggers after bulk import.
public Task EnableConstraintsAsync(CancellationToken ct = default)
GetSequenceValueAsync(CancellationToken)
Returns the current value of the global_identity sequence.
public Task<long> GetSequenceValueAsync(CancellationToken ct = default)
OpenAsync(string, CancellationToken)
Opens a connection to the database using the supplied connection string.
public Task OpenAsync(string connectionString, CancellationToken ct = default)
SetSequenceValueAsync(long, CancellationToken)
Resets the global_identity sequence to the specified value
public Task SetSequenceValueAsync(long value, CancellationToken ct = default)