Class PostgresConnectionManager

Connection manager that describes an ETLBox connection to a Postgres Server.

Inheritance
object
DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>
PostgresConnectionManager
Implements
IConnectionManager<NpgsqlConnection, NpgsqlTransaction>
System.IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.Postgres
Assembly: ETLBox.Postgres.dll
Syntax
    public class PostgresConnectionManager : DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>, IConnectionManager<NpgsqlConnection, NpgsqlTransaction>, IConnectionManager, IDisposable
Examples
var postgresConnection = new PostgresConnectionManager("Server=localhost;Database=ETLBox_Logging;User Id=postgres;Password=etlboxpassword;");

Constructors

PostgresConnectionManager()

Declaration
    public PostgresConnectionManager()
Examples
var postgresConnection = new PostgresConnectionManager("Server=localhost;Database=ETLBox_Logging;User Id=postgres;Password=etlboxpassword;");

PostgresConnectionManager(PostgresConnectionString)

Declaration
    public PostgresConnectionManager(PostgresConnectionString connectionString)
Parameters
TypeNameDescription
PostgresConnectionStringconnectionString
Examples
var postgresConnection = new PostgresConnectionManager("Server=localhost;Database=ETLBox_Logging;User Id=postgres;Password=etlboxpassword;");

PostgresConnectionManager(string)

Declaration
    public PostgresConnectionManager(string connectionString)
Parameters
TypeNameDescription
stringconnectionString
Examples
var postgresConnection = new PostgresConnectionManager("Server=localhost;Database=ETLBox_Logging;User Id=postgres;Password=etlboxpassword;");

Properties

ConnectionType

The database type for the connection manager.

Declaration
    public override ConnectionType ConnectionType { get; protected set; }
Property Value
TypeDescription
ConnectionType
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.ConnectionType

MaxParameterSizeSql

Returns the maximum amount of parameters that can be passed into a sql query.

Declaration
    public override int MaxParameterSizeSql { get; set; }
Property Value
TypeDescription
int
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.MaxParameterSizeSql

QB

The quotation begin character that is used in the database. E.g. SqlServer uses: '[' and Postgres: '"'

Declaration
    public override string QB { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.QB

QE

The quotation end character that is used in the database. E.g. SqlServer uses: ']' and Postgres: '"'

Declaration
    public override string QE { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.QE

Methods

BulkDelete(ITableData)

Performs a bulk delete

Declaration
    public override void BulkDelete(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.BulkDelete(ETLBox.ITableData)

BulkInsert(ITableData)

Performs a bulk insert

Declaration
    public override void BulkInsert(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.BulkInsert(ETLBox.ITableData)

BulkSelect(ITableData, ICollection<string>, Action, Action, params Action<object>[])

Declaration
    public override void BulkSelect(ITableData data, ICollection<string> selectColumnNames, Action beforeRowReadAction, Action afterRowReadAction, params Action<object>[] rowActions)
Parameters
TypeNameDescription
ITableDatadata
System.Collections.Generic.ICollection<T><string>selectColumnNames
System.ActionbeforeRowReadAction
System.ActionafterRowReadAction
System.Action<T><object>[]rowActions
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.BulkSelect(ETLBox.ITableData, System.Collections.Generic.ICollection<string>, System.Action, System.Action, params System.Action<object>[])

BulkUpdate(ITableData, ICollection<string>, ICollection<string>)

Performs a bulk update

Declaration
    public override void BulkUpdate(ITableData data, ICollection<string> setColumnNames, ICollection<string> joinColumnNames)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

System.Collections.Generic.ICollection<T><string>setColumnNames

The column names used in the set part of the update statement

System.Collections.Generic.ICollection<T><string>joinColumnNames

The column names to join for the update

Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.BulkUpdate(ETLBox.ITableData, System.Collections.Generic.ICollection<string>, System.Collections.Generic.ICollection<string>)

CleanUpBulkInsert(string)

Called after the whole bulk insert operation to change back settings made to improve bulk insert performance

Declaration
    public override void CleanUpBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.CleanUpBulkInsert(string)

Clone()

Cretes a clone of the current connection manager

Declaration
    public override IConnectionManager Clone()
Returns
TypeDescription
IConnectionManager

A instance copy of the current connection manager

Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.Clone()

PrepareBulkInsert(string)

Performs preparations needed to improved performance of a bulk insert operation

Declaration
    public override void PrepareBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides
ETLBox.DbConnectionManager<NpgsqlConnection, NpgsqlTransaction, NpgsqlParameter>.PrepareBulkInsert(string)

Implements

System.IDisposable