C# Class DataTableWriter.DbTableManager

Primary point of access to the functionalities of this library. Provides ability to create dynamic tables on a remote server as well as update existing table schemas to match.
显示文件 Open project: tableau/TabMon

Public Methods

Method Description
CreateTable ( IDbAdapter adapter, DataTable schema, bool>.IDictionary indexes ) : bool

Creates a table on a remote database server and indexes the table.

InitializeTable ( IDbAdapter adapter, DataTable schema, DbTableInitializationOptions tableInitializationOptions ) : void

Uses an in-memory schema to initialize a database table according to a set of initialization options.

PurgeExpiredData ( IDbAdapter adapter, string tableName, int interval ) : void
UpdateSchemaToMatchTable ( IDbAdapter adapter, DataTable schema ) : bool

Updates a schema to 'match' an existing database table by copying it.

UpdateTableToMatchSchema ( IDbAdapter adapter, DataTable schema ) : bool

Updates an existing database table to 'match' a schema by adding any missing columns.

Private Methods

Method Description
AddDbIndexesToMatch ( IDbAdapter adapter, DataTable schema, bool>.IDictionary columns ) : bool

Adds indexes to the database if the existing indexes do not match the dictionary passed in.

BuildIndexName ( string tableName, string columnName ) : string

Builds the index name from the table name and column name.

CreateIndexes ( IDbAdapter adapter, DataTable schema, bool>.IDictionary columns ) : bool

Indexes a set of columns defined by the dictionary that is passed.

RemoveDBIndexesToMatch ( IDbAdapter adapter, DataTable schema, bool>.IDictionary columns ) : bool

Removes indexes from database if indexes are not in the dictionary.

UpdateIndexClusters ( IDbAdapter adapter, DataTable schema, bool>.IDictionary columns ) : bool

Updates whether or not indexes are clustered.

Method Details

CreateTable() public static method

Creates a table on a remote database server and indexes the table.
public static CreateTable ( IDbAdapter adapter, DataTable schema, bool>.IDictionary indexes ) : bool
adapter IDbAdapter Open adapter to a database.
schema System.Data.DataTable The schema of the table to create.
indexes bool>.IDictionary A dictionary that contains the indexes to create and whether the indexes are clustered.
return bool

InitializeTable() public static method

Uses an in-memory schema to initialize a database table according to a set of initialization options.
public static InitializeTable ( IDbAdapter adapter, DataTable schema, DbTableInitializationOptions tableInitializationOptions ) : void
adapter IDbAdapter Open adapter to a database.
schema System.Data.DataTable The schema to use to initialize.
tableInitializationOptions DbTableInitializationOptions A set of options to determine initialization behavior.
return void

PurgeExpiredData() public static method

public static PurgeExpiredData ( IDbAdapter adapter, string tableName, int interval ) : void
adapter IDbAdapter
tableName string
interval int
return void

UpdateSchemaToMatchTable() public static method

Updates a schema to 'match' an existing database table by copying it.
public static UpdateSchemaToMatchTable ( IDbAdapter adapter, DataTable schema ) : bool
adapter IDbAdapter Open adapter to a database.
schema System.Data.DataTable The schema to update.
return bool

UpdateTableToMatchSchema() public static method

Updates an existing database table to 'match' a schema by adding any missing columns.
public static UpdateTableToMatchSchema ( IDbAdapter adapter, DataTable schema ) : bool
adapter IDbAdapter Open adapter to a database.
schema System.Data.DataTable The schema to use to update the database.
return bool