C# Class DataTableWriter.Drivers.PostgresDriver

Represents a mapping between Postgres-dialect SQL and the assorted actions the DbAdapter needs in order to accomplish its tasks.
Inheritance: IDbDriver
ファイルを表示 Open project: tableau/TabMon

Protected Properties

Property Type Description
postgresToSystemTypeMap string>.IReadOnlyDictionary
systemToPostgresTypeMap string>.IReadOnlyDictionary

Public Methods

Method Description
BuildConnection ( IDbConnectionInfo connectionInfo ) : IDbConnection

Builds a Postgres connection object for the given remote Postgres server.

BuildQueryAddColumnToTable ( string tableName, DataColumn column ) : string

Builds a Postgres alter statement to add a column to a table.

BuildQueryClusterIndex ( string tableName, string indexName ) : string

Builds a query to Cluster an index.

BuildQueryColumnNamesAndTypes ( string tableName, bool excludeIdentityColumn = true ) : string

Builds a Postgres query to retrieve the names and types of all columns in a table.

BuildQueryCreateTable ( string tableName, ICollection columns ) : string

Builds a table creation statement in Postgres DDL.

BuildQueryDeleteRows ( string tableName, int interval ) : string

Builds a query to delete rows older than X amount of days.

BuildQueryDropIndex ( string indexName ) : string

Builds a query to drop an index.

BuildQueryGetIndexes ( string tableName ) : string

Builds a query to find all of the indexes on a given table.

BuildQueryIndex ( string tableName, string columnName, string indexName ) : string

Builds a query to create an index.

BuildQueryInsertRow ( string tableName, ICollection columnList, IDataParameterCollection parameterList ) : string

Builds a Postgres query to insert a row of data into a table.

BuildQuerySelectTable ( string tableName ) : string

Builds a Postgres table selection statement.

GetDefaultValueClause ( object defaultValue ) : string

Generates the Postgres dialect expression of a default value.

GetIdentityColumnSpecification ( ) : string

Generates the Postgres dialect expression of an identity column specification.

GetStandardColumnSpecification ( string columnName, string columnType ) : string

Generates the Postgres dialect expression of a standard column specification.

MapToDbType ( string systemType, bool allowDbNull ) : string

Maps the name of a C# System type to a Postgres type.

MapToSystemType ( string pgType ) : Type

Maps the name of a Postgres type to a C# System type.

Method Details

BuildConnection() public method

Builds a Postgres connection object for the given remote Postgres server.
public BuildConnection ( IDbConnectionInfo connectionInfo ) : IDbConnection
connectionInfo IDbConnectionInfo The database connection information.
return IDbConnection

BuildQueryAddColumnToTable() public method

Builds a Postgres alter statement to add a column to a table.
public BuildQueryAddColumnToTable ( string tableName, DataColumn column ) : string
tableName string The name of the table to add the column to.
column System.Data.DataColumn The column to add.
return string

BuildQueryClusterIndex() public method

Builds a query to Cluster an index.
public BuildQueryClusterIndex ( string tableName, string indexName ) : string
tableName string The name of the table to alter.
indexName string The name of the index to cluster on.
return string

BuildQueryColumnNamesAndTypes() public method

Builds a Postgres query to retrieve the names and types of all columns in a table.
public BuildQueryColumnNamesAndTypes ( string tableName, bool excludeIdentityColumn = true ) : string
tableName string The name of the table to retrieve information about.
excludeIdentityColumn bool Flag indicating whether the statement should exclude the ID column.
return string

BuildQueryCreateTable() public method

Builds a table creation statement in Postgres DDL.
public BuildQueryCreateTable ( string tableName, ICollection columns ) : string
tableName string The name of the table to create.
columns ICollection The names of the columns to include in the table.
return string

BuildQueryDeleteRows() public method

Builds a query to delete rows older than X amount of days.
public BuildQueryDeleteRows ( string tableName, int interval ) : string
tableName string The name of the table to drop rows from.
interval int The interval for days to drop.
return string

BuildQueryDropIndex() public method

Builds a query to drop an index.
public BuildQueryDropIndex ( string indexName ) : string
indexName string The name of the index to drop.
return string

BuildQueryGetIndexes() public method

Builds a query to find all of the indexes on a given table.
public BuildQueryGetIndexes ( string tableName ) : string
tableName string
return string

BuildQueryIndex() public method

Builds a query to create an index.
public BuildQueryIndex ( string tableName, string columnName, string indexName ) : string
tableName string The name of the table to create the index on.
columnName string The name of the column that will be indexed.
indexName string
return string

BuildQueryInsertRow() public method

Builds a Postgres query to insert a row of data into a table.
public BuildQueryInsertRow ( string tableName, ICollection columnList, IDataParameterCollection parameterList ) : string
tableName string The name of the table to insert data into.
columnList ICollection The list of columns that make up the row.
parameterList IDataParameterCollection A collection of parameters to insert.
return string

BuildQuerySelectTable() public method

Builds a Postgres table selection statement.
public BuildQuerySelectTable ( string tableName ) : string
tableName string The name of the table to select.
return string

GetDefaultValueClause() public method

Generates the Postgres dialect expression of a default value.
public GetDefaultValueClause ( object defaultValue ) : string
defaultValue object The default value to assign.
return string

GetIdentityColumnSpecification() public method

Generates the Postgres dialect expression of an identity column specification.
public GetIdentityColumnSpecification ( ) : string
return string

GetStandardColumnSpecification() public method

Generates the Postgres dialect expression of a standard column specification.
public GetStandardColumnSpecification ( string columnName, string columnType ) : string
columnName string The name of the column.
columnType string The data type of the column.
return string

MapToDbType() public method

Maps the name of a C# System type to a Postgres type.
public MapToDbType ( string systemType, bool allowDbNull ) : string
systemType string The name of the System type.
allowDbNull bool Flag indicating whether the input type is nullable.
return string

MapToSystemType() public method

Maps the name of a Postgres type to a C# System type.
public MapToSystemType ( string pgType ) : Type
pgType string The name of the Postgres type.
return Type

Property Details

postgresToSystemTypeMap protected_oe property

protected IReadOnlyDictionary postgresToSystemTypeMap
return string>.IReadOnlyDictionary

systemToPostgresTypeMap protected_oe property

protected IReadOnlyDictionary systemToPostgresTypeMap
return string>.IReadOnlyDictionary