Beispiel #1
0
        private static Task <DataTable> PrepareCollection(FbConnection connection, string collectionName, string[] restrictions, AsyncWrappingCommonArgs async)
        {
            FbSchema returnSchema = collectionName.ToUpperInvariant() switch
            {
                "CHARACTERSETS" => new FbCharacterSets(),
                "CHECKCONSTRAINTS" => new FbCheckConstraints(),
                "CHECKCONSTRAINTSBYTABLE" => new FbChecksByTable(),
                "COLLATIONS" => new FbCollations(),
                "COLUMNS" => new FbColumns(),
                "COLUMNPRIVILEGES" => new FbColumnPrivileges(),
                "DOMAINS" => new FbDomains(),
                "FOREIGNKEYCOLUMNS" => new FbForeignKeyColumns(),
                "FOREIGNKEYS" => new FbForeignKeys(),
                "FUNCTIONS" => new FbFunctions(),
                "GENERATORS" => new FbGenerators(),
                "INDEXCOLUMNS" => new FbIndexColumns(),
                "INDEXES" => new FbIndexes(),
                "PRIMARYKEYS" => new FbPrimaryKeys(),
                "PROCEDURES" => new FbProcedures(),
                "PROCEDUREPARAMETERS" => new FbProcedureParameters(),
                "PROCEDUREPRIVILEGES" => new FbProcedurePrivilegesSchema(),
                "ROLES" => new FbRoles(),
                "TABLES" => new FbTables(),
                "TABLECONSTRAINTS" => new FbTableConstraints(),
                "TABLEPRIVILEGES" => new FbTablePrivileges(),
                "TRIGGERS" => new FbTriggers(),
                "UNIQUEKEYS" => new FbUniqueKeys(),
                "VIEWCOLUMNS" => new FbViewColumns(),
                "VIEWS" => new FbViews(),
                "VIEWPRIVILEGES" => new FbViewPrivileges(),
                _ => throw new NotSupportedException("The specified metadata collection is not supported."),
            };

            return(returnSchema.GetSchema(connection, collectionName, restrictions, async));
        }
Beispiel #2
0
        private static DataTable PrepareCollection(FbConnection connection, string collectionName, string[] restrictions)
        {
            FbSchema returnSchema = null;

            switch (collectionName.ToLower(CultureInfo.InvariantCulture))
            {
            case "charactersets":
                returnSchema = new FbCharacterSets();
                break;

            case "checkconstraints":
                returnSchema = new FbCheckConstraints();
                break;

            case "checkconstraintsbytable":
                returnSchema = new FbChecksByTable();
                break;

            case "collations":
                returnSchema = new FbCollations();
                break;

            case "columns":
                returnSchema = new FbColumns();
                break;

            case "columnprivileges":
                returnSchema = new FbColumnPrivileges();
                break;

            case "domains":
                returnSchema = new FbDomains();
                break;

            case "foreignkeycolumns":
                returnSchema = new FbForeignKeyColumns();
                break;

            case "foreignkeys":
                returnSchema = new FbForeignKeys();
                break;

            case "functions":
                returnSchema = new FbFunctions();
                break;

            case "generators":
                returnSchema = new FbGenerators();
                break;

            case "indexcolumns":
                returnSchema = new FbIndexColumns();
                break;

            case "indexes":
                returnSchema = new FbIndexes();
                break;

            case "primarykeys":
                returnSchema = new FbPrimaryKeys();
                break;

            case "procedures":
                returnSchema = new FbProcedures();
                break;

            case "procedureparameters":
                returnSchema = new FbProcedureParameters();
                break;

            case "procedureprivileges":
                returnSchema = new FbProcedurePrivilegesSchema();
                break;

            case "roles":
                returnSchema = new FbRoles();
                break;

            case "tables":
                returnSchema = new FbTables();
                break;

            case "tableconstraints":
                returnSchema = new FbTableConstraints();
                break;

            case "tableprivileges":
                returnSchema = new FbTablePrivileges();
                break;

            case "triggers":
                returnSchema = new FbTriggers();
                break;

            case "uniquekeys":
                returnSchema = new FbUniqueKeys();
                break;

            case "viewcolumns":
                returnSchema = new FbViewColumns();
                break;

            case "views":
                returnSchema = new FbViews();
                break;

            case "viewprivileges":
                returnSchema = new FbViewPrivileges();
                break;

            default:
                throw new NotSupportedException("The specified metadata collection is not supported.");
            }

            return(returnSchema.GetSchema(connection, collectionName, restrictions));
        }
        private static DataTable PrepareCollection(FbConnection connection, string collectionName, string[] restrictions)
        {
            FbSchema returnSchema = null;

            switch (collectionName.ToUpperInvariant())
            {
            case "CHARACTERSETS":
                returnSchema = new FbCharacterSets();
                break;

            case "CHECKCONSTRAINTS":
                returnSchema = new FbCheckConstraints();
                break;

            case "CHECKCONSTRAINTSBYTABLE":
                returnSchema = new FbChecksByTable();
                break;

            case "COLLATIONS":
                returnSchema = new FbCollations();
                break;

            case "COLUMNS":
                returnSchema = new FbColumns();
                break;

            case "COLUMNPRIVILEGES":
                returnSchema = new FbColumnPrivileges();
                break;

            case "DOMAINS":
                returnSchema = new FbDomains();
                break;

            case "FOREIGNKEYCOLUMNS":
                returnSchema = new FbForeignKeyColumns();
                break;

            case "FOREIGNKEYS":
                returnSchema = new FbForeignKeys();
                break;

            case "FUNCTIONS":
                returnSchema = new FbFunctions();
                break;

            case "GENERATORS":
                returnSchema = new FbGenerators();
                break;

            case "INDEXCOLUMNS":
                returnSchema = new FbIndexColumns();
                break;

            case "INDEXES":
                returnSchema = new FbIndexes();
                break;

            case "PRIMARYKEYS":
                returnSchema = new FbPrimaryKeys();
                break;

            case "PROCEDURES":
                returnSchema = new FbProcedures();
                break;

            case "PROCEDUREPARAMETERS":
                returnSchema = new FbProcedureParameters();
                break;

            case "PROCEDUREPRIVILEGES":
                returnSchema = new FbProcedurePrivilegesSchema();
                break;

            case "ROLES":
                returnSchema = new FbRoles();
                break;

            case "TABLES":
                returnSchema = new FbTables();
                break;

            case "TABLECONSTRAINTS":
                returnSchema = new FbTableConstraints();
                break;

            case "TABLEPRIVILEGES":
                returnSchema = new FbTablePrivileges();
                break;

            case "TRIGGERS":
                returnSchema = new FbTriggers();
                break;

            case "UNIQUEKEYS":
                returnSchema = new FbUniqueKeys();
                break;

            case "VIEWCOLUMNS":
                returnSchema = new FbViewColumns();
                break;

            case "VIEWS":
                returnSchema = new FbViews();
                break;

            case "VIEWPRIVILEGES":
                returnSchema = new FbViewPrivileges();
                break;

            default:
                throw new NotSupportedException("The specified metadata collection is not supported.");
            }

            return(returnSchema.GetSchema(connection, collectionName, restrictions));
        }