Class DB2SchemaProvider
Provides schema-related functionalities for a DB2 database, such as accessing table names, column names, index names, and foreign key names.
public class DB2SchemaProvider : ISchemaProvider
- Inheritance
-
DB2SchemaProvider
- Implements
- Inherited Members
Constructors
DB2SchemaProvider(string)
Initializes a new instance of the DB2SchemaProvider class.
public DB2SchemaProvider(string connectionString)
Parameters
connectionStringstringThe connection string used to connect to the DB2 database.
Properties
ConnectionString
Gets the connection string used to connect to the database.
public string ConnectionString { get; }
Property Value
DatabaseName
Gets the name of the database for which the schema information is being retrieved.
public string DatabaseName { get; }
Property Value
ProviderName
Gets the name of the database provider.
public string ProviderName { get; }
Property Value
Methods
GetColumnMeta(string, string, string)
Extracts the metadata for a specified column within a table and its owner, including information such as data type, nullability, default values, and other relevant schema details specific to the column.
public MetaData GetColumnMeta(string tableName, string tableOwner, string columnName)
Parameters
tableNamestringThe name of the table containing the column for which to retrieve metadata.
tableOwnerstringThe owner of the table containing the column for which to retrieve metadata.
columnNamestringThe name of the column for which to retrieve metadata.
Returns
GetColumnNames(string, string)
Extracts the names of all columns for a specified table and its owner.
public string[] GetColumnNames(string tableName, string tableOwner)
Parameters
tableNamestringThe name of the table for which to retrieve column names.
tableOwnerstringThe owner of the table for which to retrieve column names.
Returns
- string[]
An array of column names for the specified table and owner.
GetForeignKeyMeta(string, string, string)
Extracts the metadata for a specified foreign key within a table and its owner, including information such as referenced table and columns, foreign key constraints, and other relevant schema details specific to the foreign key relationship.
public MetaData GetForeignKeyMeta(string tableName, string tableOwner, string fkName)
Parameters
tableNamestringThe name of the table containing the foreign key for which to retrieve metadata.
tableOwnerstringThe owner of the table containing the foreign key for which to retrieve metadata.
fkNamestringThe name of the foreign key for which to retrieve metadata.
Returns
GetForeignKeyNames(string, string)
Extracts the names of all foreign keys for a specified table and its owner.
public string[] GetForeignKeyNames(string tableName, string tableOwner)
Parameters
tableNamestringThat name of the table for which to retrieve foreign key names.
tableOwnerstringThe owner of the table for which to retrieve foreign key names.
Returns
- string[]
An array of foreign key names for the specified table and owner.
GetIndexMeta(string, string, string)
Extracts the metadata for a specified index within a table and its owner, including information such as index type, indexed columns, uniqueness, and other relevant schema details specific to the index.
public MetaData GetIndexMeta(string tableName, string tableOwner, string indexName)
Parameters
tableNamestringThe name of the table containing the index for which to retrieve metadata.
tableOwnerstringThe owner of the table containing the index for which to retrieve metadata.
indexNamestringThe name of the index for which to retrieve metadata.
Returns
GetIndexNames(string, string)
Extracts the names of all indexes for a specified table and its owner.
public string[] GetIndexNames(string tableName, string tableOwner)
Parameters
tableNamestringThe name of the table for which to retrieve index names.
tableOwnerstringThe owner of the table for which to retrieve index names.
Returns
- string[]
An array of index names for the specified table and owner.
GetTableMeta(string, string)
Extracts the metadata for a specified table and its owner, including information such as column data types, index definitions, foreign key relationships, and other relevant schema details.
public MetaData GetTableMeta(string tableName, string tableOwner)
Parameters
tableNamestringThe name of the table for which to retrieve metadata.
tableOwnerstringThe owner of the table for which to retrieve metadata.
Returns
GetTableNames()
Extracts the names of all tables in the database, along with their respective owners.
public NameOwnerPair[] GetTableNames()
Returns
- NameOwnerPair[]
An array of NameOwnerPair objects, each containing the name and owner of a table.