When you call DbConnection.GetSchema you give it the string name of a collection you are interested in. I can't find a list of collections anywhere. Is the list of collections immutable or does it vary by database type (orcle, sql server, etc.)?
I'm interested in getting a list of all collection names in a few database types such as sql server, and sqlite.
I use an OleDbConnection even if I'm connecting with Oracle, Sql Server... Then I can use:
myOleDbConnection.GetOleDbSchemaTable(OleDbSchemGuid.Tables);
Possible values for OleDbSchemaGuid:
(note that depending of the database some of these can throw a NotSupported Exception:
OleDbSchemaGuid.Assertions;
OleDbSchemaGuid.Catalogs;
OleDbSchemaGuid.Character_Sets;
OleDbSchemaGuid.Check_Constraints;
OleDbSchemaGuid.Check_Constraints_By_Table;
OleDbSchemaGuid.Collations;
OleDbSchemaGuid.Column_Domain_Usage;
OleDbSchemaGuid.Column_Privileges;
OleDbSchemaGuid.Columns;
OleDbSchemaGuid.Constraint_Column_Usage;
OleDbSchemaGuid.Constraint_Table_Usage;
OleDbSchemaGuid.DbInfoKeywords;
OleDbSchemaGuid.DbInfoLiterals;
OleDbSchemaGuid.Foreign_Keys;
OleDbSchemaGuid.Indexes;
OleDbSchemaGuid.Key_Column_Usage;
OleDbSchemaGuid.Primary_Keys;
OleDbSchemaGuid.Procedure_Columns;
OleDbSchemaGuid.Procedure_Parameters;
OleDbSchemaGuid.Procedures;
OleDbSchemaGuid.Provider_Types;
OleDbSchemaGuid.Referential_Constraints;
OleDbSchemaGuid.SchemaGuids;
OleDbSchemaGuid.Schemata;
OleDbSchemaGuid.Sql_Languages;
OleDbSchemaGuid.Statistics;
OleDbSchemaGuid.Table_Constraints;
OleDbSchemaGuid.Table_Privileges;
OleDbSchemaGuid.Table_Statistics;
OleDbSchemaGuid.Tables;
OleDbSchemaGuid.Tables_Info;
OleDbSchemaGuid.Translations;
OleDbSchemaGuid.Trustee;
OleDbSchemaGuid.Usage_Privileges;
OleDbSchemaGuid.View_Column_Usage;
OleDbSchemaGuid.View_Table_Usage;
OleDbSchemaGuid.Views;
The list varies by provider. For this reason, some Common Schema Collections have been defined, that are always available regardless of the provider. One of them is the MetaDataCollections collection, which will return a DataTable with a list of the supported schema collections for the current provider, the number of restrictions that they each support, and the number of identifier parts that they use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With