Class NpgsqlBinaryExporter
Provides an API for a binary COPY TO operation, a high-performance data export mechanism from a PostgreSQL table. Initiated by BeginBinaryExport(String)
Inheritance
Implements
Namespace: Npgsql
Assembly: Npgsql.dll
Syntax
public sealed class NpgsqlBinaryExporter : object, ICancelable, IDisposable
Properties
IsNull
Returns whether the current column is null.
Declaration
public bool IsNull { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
Cancel()
Cancels an ongoing export.
Declaration
public void Cancel()
Dispose()
Completes that binary export and sets the connection back to idle state
Declaration
public void Dispose()
Read<T>()
Reads the current column, returns its value and moves ahead to the next column. If the column is null an exception is thrown.
Declaration
public T Read<T>()
Returns
Type | Description |
---|---|
T | The value of the column |
Type Parameters
Name | Description |
---|---|
T | The type of the column to be read. This must correspond to the actual type or data corruption will occur. If in doubt, use Read<T>(NpgsqlDbType) to manually specify the type. |
Read<T>(NpgsqlDbType)
Reads the current column, returns its value according to type
and
moves ahead to the next column.
If the column is null an exception is thrown.
Declaration
public T Read<T>(NpgsqlDbType type)
Parameters
Type | Name | Description |
---|---|---|
NpgsqlDbType | type | In some cases |
Returns
Type | Description |
---|---|
T | The value of the column |
Type Parameters
Name | Description |
---|---|
T | The .NET type of the column to be read. |
Skip()
Skips the current column without interpreting its value.
Declaration
public void Skip()
StartRow()
Starts reading a single row, must be invoked before reading any columns.
Declaration
public int StartRow()
Returns
Type | Description |
---|---|
System.Int32 | The number of columns in the row. -1 if there are no further rows. Note: This will currently be the same value for all rows, but this may change in the future. |