in MySQL.Data/src/SchemaProvider.cs [886:939]
protected virtual async Task<MySqlSchemaCollection> GetSchemaInternalAsync(string collection, string[] restrictions, bool execAsync, CancellationToken cancellationToken = default)
{
switch (collection)
{
// common collections
case "METADATACOLLECTIONS":
return GetCollections();
case "DATASOURCEINFORMATION":
return GetDataSourceInformation();
case "DATATYPES":
return GetDataTypes();
case "RESTRICTIONS":
return GetRestrictions();
case "RESERVEDWORDS":
return GetReservedWords();
// collections specific to our provider
case "USERS":
return await GetUsersAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "DATABASES":
return await GetDatabasesAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "UDF":
return await GetUDFAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
}
// if we have a current database and our users have
// not specified a database, then default to the currently
// selected one.
if (restrictions == null)
restrictions = new string[2];
if (connection != null &&
connection.Database != null &&
connection.Database.Length > 0 &&
restrictions.Length > 1 &&
restrictions[1] == null)
restrictions[1] = connection.Database;
switch (collection)
{
case "TABLES":
return await GetTablesAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "COLUMNS":
return await GetColumnsAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "INDEXES":
return await GetIndexesAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "INDEXCOLUMNS":
return await GetIndexColumnsAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "FOREIGN KEYS":
return await GetForeignKeysAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
case "FOREIGN KEY COLUMNS":
return await GetForeignKeyColumnsAsync(restrictions, execAsync, cancellationToken).ConfigureAwait(false);
}
return null;
}