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
Afficher le fichier Open project: tableau/TabMon

Protected Properties

Свойство Type Description
postgresToSystemTypeMap string>.IReadOnlyDictionary
systemToPostgresTypeMap string>.IReadOnlyDictionary

Méthodes publiques

Méthode 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 méthode

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

BuildQueryAddColumnToTable() public méthode

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.
Résultat string

BuildQueryClusterIndex() public méthode

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.
Résultat string

BuildQueryColumnNamesAndTypes() public méthode

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.
Résultat string

BuildQueryCreateTable() public méthode

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.
Résultat string

BuildQueryDeleteRows() public méthode

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.
Résultat string

BuildQueryDropIndex() public méthode

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

BuildQueryGetIndexes() public méthode

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

BuildQueryIndex() public méthode

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
Résultat string

BuildQueryInsertRow() public méthode

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.
Résultat string

BuildQuerySelectTable() public méthode

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

GetDefaultValueClause() public méthode

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

GetIdentityColumnSpecification() public méthode

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

GetStandardColumnSpecification() public méthode

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.
Résultat string

MapToDbType() public méthode

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.
Résultat string

MapToSystemType() public méthode

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.
Résultat Type

Property Details

postgresToSystemTypeMap protected_oe property

protected IReadOnlyDictionary postgresToSystemTypeMap
Résultat string>.IReadOnlyDictionary

systemToPostgresTypeMap protected_oe property

protected IReadOnlyDictionary systemToPostgresTypeMap
Résultat string>.IReadOnlyDictionary