package org.jooq.impl;

import static org.jooq.SQLDialect.*;

import java.util.EnumMap;

import org.jooq.SQLDialect;

// The queries generated by MetaGeneration from the various jOOQ-meta ResultQueryDatabase types.
final class MetaSQL {
    private static final EnumMap<SQLDialect, String> M_UNIQUE_KEYS = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_SEQUENCES = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_ENUMS = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_SOURCES = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_COMMENTS = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_GENERATORS = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_TRIGGERS = new EnumMap<>(SQLDialect.class);
    private static final EnumMap<SQLDialect, String> M_SYNONYMS = new EnumMap<>(SQLDialect.class);

    static final String M_UNIQUE_KEYS(SQLDialect dialect) {
        String result = M_UNIQUE_KEYS.get(dialect);
        return result != null ? result : M_UNIQUE_KEYS.get(dialect.family());
    }

    static final String M_SEQUENCES(SQLDialect dialect) {
        String result = M_SEQUENCES.get(dialect);
        return result != null ? result : M_SEQUENCES.get(dialect.family());
    }

    static final String M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES(SQLDialect dialect) {
        String result = M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.get(dialect);
        return result != null ? result : M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.get(dialect.family());
    }

    static final String M_ENUMS(SQLDialect dialect) {
        String result = M_ENUMS.get(dialect);
        return result != null ? result : M_ENUMS.get(dialect.family());
    }

    static final String M_SOURCES(SQLDialect dialect) {
        String result = M_SOURCES.get(dialect);
        return result != null ? result : M_SOURCES.get(dialect.family());
    }

    static final String M_COMMENTS(SQLDialect dialect) {
        String result = M_COMMENTS.get(dialect);
        return result != null ? result : M_COMMENTS.get(dialect.family());
    }

    static final String M_GENERATORS(SQLDialect dialect) {
        String result = M_GENERATORS.get(dialect);
        return result != null ? result : M_GENERATORS.get(dialect.family());
    }

    static final String M_TRIGGERS(SQLDialect dialect) {
        String result = M_TRIGGERS.get(dialect);
        return result != null ? result : M_TRIGGERS.get(dialect.family());
    }

    static final String M_SYNONYMS(SQLDialect dialect) {
        String result = M_SYNONYMS.get(dialect);
        return result != null ? result : M_SYNONYMS.get(dialect.family());
    }

    static {

        M_UNIQUE_KEYS.put(DUCKDB, "select duckdb_constraints.database_name, duckdb_constraints.schema_name, duckdb_constraints.table_name, duckdb_constraints.constraint_name, unnest(duckdb_constraints.constraint_column_names) constraint_column_names, unnest(duckdb_constraints.constraint_column_indexes) constraint_column_indexes from duckdb_constraints() where (duckdb_constraints.constraint_type = 'UNIQUE' and duckdb_constraints.schema_name in (cast(? as varchar)))");
        M_UNIQUE_KEYS.put(FIREBIRD, "select null catalog, null schema, trim(RDB$RELATION_CONSTRAINTS.RDB$RELATION_NAME) RDB$RELATION_NAME, trim(RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME) RDB$CONSTRAINT_NAME, trim(RDB$INDEX_SEGMENTS.RDB$FIELD_NAME) RDB$FIELD_NAME, RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION from RDB$RELATION_CONSTRAINTS join RDB$INDEX_SEGMENTS on RDB$INDEX_SEGMENTS.RDB$INDEX_NAME = RDB$RELATION_CONSTRAINTS.RDB$INDEX_NAME where RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_TYPE = 'UNIQUE' order by RDB$RELATION_CONSTRAINTS.RDB$CONSTRAINT_NAME asc, RDB$INDEX_SEGMENTS.RDB$FIELD_POSITION asc");
        M_UNIQUE_KEYS.put(H2, "select INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_CATALOG, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION from (INFORMATION_SCHEMA.KEY_COLUMN_USAGE left outer join INFORMATION_SCHEMA.TABLE_CONSTRAINTS alias_10316587 on (INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_CATALOG = alias_10316587.CONSTRAINT_CATALOG and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA = alias_10316587.CONSTRAINT_SCHEMA and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME = alias_10316587.CONSTRAINT_NAME)) where (alias_10316587.CONSTRAINT_TYPE in ('UNIQUE') and alias_10316587.TABLE_SCHEMA in (cast(? as varchar(128)))) order by INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION asc");
        M_UNIQUE_KEYS.put(HSQLDB, "select INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_CATALOG, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION from (INFORMATION_SCHEMA.KEY_COLUMN_USAGE left outer join INFORMATION_SCHEMA.TABLE_CONSTRAINTS as alias_10316587 on (INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_CATALOG = alias_10316587.CONSTRAINT_CATALOG and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA = alias_10316587.CONSTRAINT_SCHEMA and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME = alias_10316587.CONSTRAINT_NAME)) where (alias_10316587.CONSTRAINT_TYPE = 'UNIQUE' and alias_10316587.TABLE_SCHEMA in (cast(? as varchar(128)))) order by INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME asc, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.ORDINAL_POSITION asc");
        M_UNIQUE_KEYS.put(MARIADB, "select distinct null as TABLE_CATALOG, information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.COLUMN_NAME, information_schema.STATISTICS.SEQ_IN_INDEX from information_schema.STATISTICS where (information_schema.STATISTICS.TABLE_SCHEMA in (?, 'ee7f6174-34f2-484b-8d81-20a4d9fc866d') and information_schema.STATISTICS.INDEX_NAME <> 'PRIMARY' and information_schema.STATISTICS.NON_UNIQUE = 0) order by information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.SEQ_IN_INDEX");
        M_UNIQUE_KEYS.put(MYSQL, "select distinct null as TABLE_CATALOG, information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.COLUMN_NAME, information_schema.STATISTICS.SEQ_IN_INDEX from information_schema.STATISTICS where (information_schema.STATISTICS.TABLE_SCHEMA in (?, 'ee7f6174-34f2-484b-8d81-20a4d9fc866d') and information_schema.STATISTICS.INDEX_NAME <> 'PRIMARY' and information_schema.STATISTICS.NON_UNIQUE = 0) order by information_schema.STATISTICS.TABLE_SCHEMA, information_schema.STATISTICS.TABLE_NAME, information_schema.STATISTICS.INDEX_NAME, information_schema.STATISTICS.SEQ_IN_INDEX");
        M_UNIQUE_KEYS.put(POSTGRES, "select k.table_catalog, k.table_schema, k.table_name, k.constraint_name, k.column_name, k.ordinal_position from (pg_catalog.pg_constraint as c join (pg_catalog.pg_class as alias_89552482 join pg_catalog.pg_namespace as alias_126892781 on alias_89552482.relnamespace = alias_126892781.oid) on c.conrelid = alias_89552482.oid join pg_catalog.pg_namespace as alias_87501535 on c.connamespace = alias_87501535.oid) join information_schema.key_column_usage as k on (k.table_schema = alias_126892781.nspname and k.table_name = alias_89552482.relname and k.constraint_schema = alias_87501535.nspname and k.constraint_name = c.conname) where (c.contype = 'u' and alias_87501535.nspname in (?)) order by k.table_schema asc, k.table_name asc, k.constraint_name asc, k.ordinal_position asc");
        M_UNIQUE_KEYS.put(YUGABYTEDB, "select k.table_catalog, k.table_schema, k.table_name, k.constraint_name, k.column_name, k.ordinal_position from (pg_catalog.pg_constraint as c join (pg_catalog.pg_class as alias_89552482 join pg_catalog.pg_namespace as alias_126892781 on alias_89552482.relnamespace = alias_126892781.oid) on c.conrelid = alias_89552482.oid join pg_catalog.pg_namespace as alias_87501535 on c.connamespace = alias_87501535.oid) join information_schema.key_column_usage as k on (k.table_schema = alias_126892781.nspname and k.table_name = alias_89552482.relname and k.constraint_schema = alias_87501535.nspname and k.constraint_name = c.conname) where (c.contype = 'u' and alias_87501535.nspname in (?)) order by k.table_schema asc, k.table_name asc, k.constraint_name asc, k.ordinal_position asc");







































































        M_SEQUENCES.put(DERBY, "select cast(null as varchar(32672)) as catalog, SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSSEQUENCES.SEQUENCENAME, SYS.SYSSEQUENCES.SEQUENCEDATATYPE, cast(null as int) as numeric_precision, cast(null as int) as numeric_scale, nullif(SYS.SYSSEQUENCES.STARTVALUE, 1) as STARTVALUE, nullif(SYS.SYSSEQUENCES.INCREMENT, 1) as INCREMENT, nullif(SYS.SYSSEQUENCES.MINIMUMVALUE, case when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'SMALLINT' then -32768 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'INTEGER' then -2147483648 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'BIGINT' then -9223372036854775808 end) as MINIMUMVALUE, nullif(SYS.SYSSEQUENCES.MAXIMUMVALUE, case when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'SMALLINT' then 32767 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'INTEGER' then 2147483647 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'BIGINT' then 9223372036854775807 end) as MAXIMUMVALUE, (SYS.SYSSEQUENCES.CYCLEOPTION = 'Y') as CYCLEOPTION, cast(null as bigint) as cache from SYS.SYSSEQUENCES join SYS.SYSSCHEMAS on SYS.SYSSEQUENCES.SCHEMAID = SYS.SYSSCHEMAS.SCHEMAID where cast(SYS.SYSSCHEMAS.SCHEMANAME as varchar(32672)) in (cast(? as varchar(32672))) order by SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSSEQUENCES.SEQUENCENAME");
        M_SEQUENCES.put(DUCKDB, "select database_name, schema_name, sequence_name, 'bigint' as data_type, 0 as precision, 0 as scale, start_value, increment_by, min_value, max_value, cycle, 0 as cache from duckdb_sequences() where schema_name in (cast(? as varchar)) ");
        M_SEQUENCES.put(FIREBIRD, "select null catalog, null schema, trim(RDB$GENERATORS.RDB$GENERATOR_NAME) RDB$GENERATOR_NAME, 'BIGINT' type_name, null numeric_precision, null numeric_scale, nullif(RDB$GENERATORS.RDB$INITIAL_VALUE, 0) RDB$INITIAL_VALUE, nullif(RDB$GENERATORS.RDB$GENERATOR_INCREMENT, 1) RDB$GENERATOR_INCREMENT, null min_value, null max_value, null cycle, null cache from RDB$GENERATORS where RDB$GENERATORS.RDB$GENERATOR_NAME not in (select RDB$RELATION_FIELDS.RDB$GENERATOR_NAME from RDB$RELATION_FIELDS where (RDB$RELATION_FIELDS.RDB$GENERATOR_NAME is not null and RDB$RELATION_FIELDS.RDB$IDENTITY_TYPE = 1)) order by RDB$GENERATORS.RDB$GENERATOR_NAME");
        M_SEQUENCES.put(H2, "select null catalog, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME, SEQUENCES.DATA_TYPE type_name, null precision, null scale, null start_value, nullif(INFORMATION_SCHEMA.SEQUENCES.INCREMENT, 1) INCREMENT, nullif(SEQUENCES.MINIMUM_VALUE, 1) MIN_VALUE, nullif(SEQUENCES.MAXIMUM_VALUE, 9223372036854775807) MAX_VALUE, (SEQUENCES.CYCLE_OPTION = 'YES') IS_CYCLE, nullif(INFORMATION_SCHEMA.SEQUENCES.CACHE, 32) CACHE from INFORMATION_SCHEMA.SEQUENCES where (INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA in (cast(? as varchar)) and upper(INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME) not like 'SYSTEM!_SEQUENCE!_%' escape '!') order by INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME");
        M_SEQUENCES.put(HSQLDB, "select null as catalog, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME, INFORMATION_SCHEMA.SEQUENCES.DATA_TYPE, INFORMATION_SCHEMA.SEQUENCES.NUMERIC_PRECISION, INFORMATION_SCHEMA.SEQUENCES.NUMERIC_SCALE, INFORMATION_SCHEMA.SEQUENCES.START_WITH, INFORMATION_SCHEMA.SEQUENCES.INCREMENT, INFORMATION_SCHEMA.SEQUENCES.MINIMUM_VALUE, INFORMATION_SCHEMA.SEQUENCES.MAXIMUM_VALUE, case when INFORMATION_SCHEMA.SEQUENCES.CYCLE_OPTION is not distinct from 'YES' then true else false end as CYCLE_OPTION, null as cache from INFORMATION_SCHEMA.SEQUENCES where INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA in (cast(? as varchar(128))) order by INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME");
        M_SEQUENCES.put(POSTGRES, "with schemas(schema) as (select v.c1 from (values (?)) as v (c1)) (select null as catalog, information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name, information_schema.sequences.data_type, information_schema.sequences.numeric_precision, information_schema.sequences.numeric_scale, nullif(cast(information_schema.sequences.start_value as bigint), 1) as start_value, nullif(cast(information_schema.sequences.increment as bigint), 1) as increment, nullif(cast(information_schema.sequences.minimum_value as bigint), 1) as minimum_value, nullif(cast(information_schema.sequences.maximum_value as decimal), (power(cast(2 as decimal), cast((information_schema.sequences.numeric_precision - 1) as decimal)) - 1)) as maximum_value, cast(information_schema.sequences.cycle_option as boolean) as cycle_option, cast(null as bigint) as cache from information_schema.sequences where (information_schema.sequences.sequence_schema in (select schemas.schema from schemas) and (information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name) not in (select information_schema.columns.table_schema, (information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq') from information_schema.columns where (information_schema.columns.column_default = ('nextval(''' || information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq''::regclass)') or information_schema.columns.column_default = ('nextval(''' || information_schema.columns.table_schema || '.' || information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq''::regclass)'))))) union all (select '', '', '', '', 0, 0, 0, 0, 0, 0, false, 0 where false) order by 2, 3");
        M_SEQUENCES.put(YUGABYTEDB, "with schemas(schema) as (select v.c1 from (values (?)) as v (c1)) (select null as catalog, information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name, information_schema.sequences.data_type, information_schema.sequences.numeric_precision, information_schema.sequences.numeric_scale, nullif(cast(information_schema.sequences.start_value as bigint), 1) as start_value, nullif(cast(information_schema.sequences.increment as bigint), 1) as increment, nullif(cast(information_schema.sequences.minimum_value as bigint), 1) as minimum_value, nullif(cast(information_schema.sequences.maximum_value as decimal), (power(cast(2 as decimal), cast((information_schema.sequences.numeric_precision - 1) as decimal)) - 1)) as maximum_value, cast(information_schema.sequences.cycle_option as boolean) as cycle_option, cast(null as bigint) as cache from information_schema.sequences where (information_schema.sequences.sequence_schema in (select schemas.schema from schemas) and (information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name) not in (select information_schema.columns.table_schema, (information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq') from information_schema.columns where (information_schema.columns.column_default = ('nextval(''' || information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq''::regclass)') or information_schema.columns.column_default = ('nextval(''' || information_schema.columns.table_schema || '.' || information_schema.columns.table_name || '_' || information_schema.columns.column_name || '_seq''::regclass)'))))) union all (select '', '', '', '', 0, 0, 0, 0, 0, 0, false, 0 where false) order by 2, 3");



















































        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(DERBY, "select cast(null as varchar(32672)) as catalog, SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSSEQUENCES.SEQUENCENAME, SYS.SYSSEQUENCES.SEQUENCEDATATYPE, cast(null as int) as numeric_precision, cast(null as int) as numeric_scale, nullif(SYS.SYSSEQUENCES.STARTVALUE, 1) as STARTVALUE, nullif(SYS.SYSSEQUENCES.INCREMENT, 1) as INCREMENT, nullif(SYS.SYSSEQUENCES.MINIMUMVALUE, case when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'SMALLINT' then -32768 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'INTEGER' then -2147483648 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'BIGINT' then -9223372036854775808 end) as MINIMUMVALUE, nullif(SYS.SYSSEQUENCES.MAXIMUMVALUE, case when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'SMALLINT' then 32767 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'INTEGER' then 2147483647 when cast(SYS.SYSSEQUENCES.SEQUENCEDATATYPE as varchar(32672)) = 'BIGINT' then 9223372036854775807 end) as MAXIMUMVALUE, (SYS.SYSSEQUENCES.CYCLEOPTION = 'Y') as CYCLEOPTION, cast(null as bigint) as cache from SYS.SYSSEQUENCES join SYS.SYSSCHEMAS on SYS.SYSSEQUENCES.SCHEMAID = SYS.SYSSCHEMAS.SCHEMAID where cast(SYS.SYSSCHEMAS.SCHEMANAME as varchar(32672)) in (cast(? as varchar(32672))) order by SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSSEQUENCES.SEQUENCENAME");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(DUCKDB, "select database_name, schema_name, sequence_name, 'bigint' as data_type, 0 as precision, 0 as scale, start_value, increment_by, min_value, max_value, cycle, 0 as cache from duckdb_sequences() where schema_name in (cast(? as varchar)) ");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(FIREBIRD, "select null catalog, null schema, trim(RDB$GENERATORS.RDB$GENERATOR_NAME) RDB$GENERATOR_NAME, 'BIGINT' type_name, null numeric_precision, null numeric_scale, nullif(RDB$GENERATORS.RDB$INITIAL_VALUE, 0) RDB$INITIAL_VALUE, nullif(RDB$GENERATORS.RDB$GENERATOR_INCREMENT, 1) RDB$GENERATOR_INCREMENT, null min_value, null max_value, null cycle, null cache from RDB$GENERATORS order by RDB$GENERATORS.RDB$GENERATOR_NAME");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(H2, "select null catalog, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME, SEQUENCES.DATA_TYPE type_name, null precision, null scale, null start_value, nullif(INFORMATION_SCHEMA.SEQUENCES.INCREMENT, 1) INCREMENT, nullif(SEQUENCES.MINIMUM_VALUE, 1) MIN_VALUE, nullif(SEQUENCES.MAXIMUM_VALUE, 9223372036854775807) MAX_VALUE, (SEQUENCES.CYCLE_OPTION = 'YES') IS_CYCLE, nullif(INFORMATION_SCHEMA.SEQUENCES.CACHE, 32) CACHE from INFORMATION_SCHEMA.SEQUENCES where INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA in (cast(? as varchar)) order by INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(HSQLDB, "select null as catalog, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME, INFORMATION_SCHEMA.SEQUENCES.DATA_TYPE, INFORMATION_SCHEMA.SEQUENCES.NUMERIC_PRECISION, INFORMATION_SCHEMA.SEQUENCES.NUMERIC_SCALE, INFORMATION_SCHEMA.SEQUENCES.START_WITH, INFORMATION_SCHEMA.SEQUENCES.INCREMENT, INFORMATION_SCHEMA.SEQUENCES.MINIMUM_VALUE, INFORMATION_SCHEMA.SEQUENCES.MAXIMUM_VALUE, case when INFORMATION_SCHEMA.SEQUENCES.CYCLE_OPTION is not distinct from 'YES' then true else false end as CYCLE_OPTION, null as cache from INFORMATION_SCHEMA.SEQUENCES where INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA in (cast(? as varchar(128))) order by INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_SCHEMA, INFORMATION_SCHEMA.SEQUENCES.SEQUENCE_NAME");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(POSTGRES, "with schemas(schema) as (select v.c1 from (values (?)) as v (c1)) (select null as catalog, information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name, information_schema.sequences.data_type, information_schema.sequences.numeric_precision, information_schema.sequences.numeric_scale, nullif(cast(information_schema.sequences.start_value as bigint), 1) as start_value, nullif(cast(information_schema.sequences.increment as bigint), 1) as increment, nullif(cast(information_schema.sequences.minimum_value as bigint), 1) as minimum_value, nullif(cast(information_schema.sequences.maximum_value as decimal), (power(cast(2 as decimal), cast((information_schema.sequences.numeric_precision - 1) as decimal)) - 1)) as maximum_value, cast(information_schema.sequences.cycle_option as boolean) as cycle_option, cast(null as bigint) as cache from information_schema.sequences where information_schema.sequences.sequence_schema in (select schemas.schema from schemas)) union all (select null, alias_14763223.nspname, alias_75351712.relname, alias_109453426.typname, information_schema._pg_numeric_precision(alias_109453426.typbasetype, alias_109453426.typtypmod), 0, pg_catalog.pg_sequence.seqstart, pg_catalog.pg_sequence.seqincrement, pg_catalog.pg_sequence.seqmin, pg_catalog.pg_sequence.seqmax, pg_catalog.pg_sequence.seqcycle, cast(null as bigint) as cache from (pg_catalog.pg_sequence join (pg_catalog.pg_class as alias_75351712 join pg_catalog.pg_namespace as alias_14763223 on alias_75351712.relnamespace = alias_14763223.oid) on pg_catalog.pg_sequence.seqrelid = alias_75351712.oid join pg_catalog.pg_type as alias_109453426 on pg_catalog.pg_sequence.seqtypid = alias_109453426.oid) where (alias_14763223.nspname in (select schemas.schema from schemas) and alias_75351712.oid in (select pg_catalog.pg_depend.objid from pg_catalog.pg_depend where (pg_catalog.pg_depend.deptype = 'i' and pg_catalog.pg_depend.classid = 'pg_class'::regclass)))) order by 2, 3");
        M_SEQUENCES_INCLUDING_SYSTEM_SEQUENCES.put(YUGABYTEDB, "with schemas(schema) as (select v.c1 from (values (?)) as v (c1)) (select null as catalog, information_schema.sequences.sequence_schema, information_schema.sequences.sequence_name, information_schema.sequences.data_type, information_schema.sequences.numeric_precision, information_schema.sequences.numeric_scale, nullif(cast(information_schema.sequences.start_value as bigint), 1) as start_value, nullif(cast(information_schema.sequences.increment as bigint), 1) as increment, nullif(cast(information_schema.sequences.minimum_value as bigint), 1) as minimum_value, nullif(cast(information_schema.sequences.maximum_value as decimal), (power(cast(2 as decimal), cast((information_schema.sequences.numeric_precision - 1) as decimal)) - 1)) as maximum_value, cast(information_schema.sequences.cycle_option as boolean) as cycle_option, cast(null as bigint) as cache from information_schema.sequences where information_schema.sequences.sequence_schema in (select schemas.schema from schemas)) union all (select '', '', '', '', 0, 0, 0, 0, 0, 0, false, 0 where false) order by 2, 3");



















































        M_ENUMS.put(MARIADB, "with recursive e as (select information_schema.COLUMNS.TABLE_SCHEMA, information_schema.COLUMNS.TABLE_NAME, information_schema.COLUMNS.COLUMN_NAME, regexp_replace(information_schema.COLUMNS.COLUMN_TYPE, 'enum\\\\((.*)\\\\)', '$1') as e from information_schema.COLUMNS where information_schema.COLUMNS.DATA_TYPE = 'enum'), l as (select e.TABLE_SCHEMA, e.TABLE_NAME, e.COLUMN_NAME, e, cast('' as char(32767)) as l, 0 as p from e union all select e.TABLE_SCHEMA, e.TABLE_NAME, e.COLUMN_NAME, regexp_replace(e, '''.*?''(?:,|$)(.*)', '$1', 1, 1), replace(regexp_replace(e, '''(.*?)''(?:,|$).*', '$1', 1, 1), '''''', ''''), (p + 1) from l as e where char_length(e) > 0) select l.TABLE_SCHEMA, l.TABLE_NAME, l.COLUMN_NAME, null as DATA_TYPE, l.l, l.p from l where (p > 0 and l.TABLE_SCHEMA in (?)) order by l.TABLE_SCHEMA, l.TABLE_NAME, l.COLUMN_NAME, l.p");
        M_ENUMS.put(MYSQL, "with recursive e as (select information_schema.COLUMNS.TABLE_SCHEMA, information_schema.COLUMNS.TABLE_NAME, information_schema.COLUMNS.COLUMN_NAME, regexp_replace(information_schema.COLUMNS.COLUMN_TYPE, 'enum\\\\((.*)\\\\)', '$1') as e from information_schema.COLUMNS where information_schema.COLUMNS.DATA_TYPE = 'enum'), l as (select e.TABLE_SCHEMA, e.TABLE_NAME, e.COLUMN_NAME, e, cast('' as char(32767)) as l, 0 as p from e union all select e.TABLE_SCHEMA, e.TABLE_NAME, e.COLUMN_NAME, regexp_replace(e, '''.*?''(?:,|$)(.*)', '$1', 1, 1), replace(regexp_replace(e, '''(.*?)''(?:,|$).*', '$1', 1, 1), '''''', ''''), (p + 1) from l as e where char_length(e) > 0) select l.TABLE_SCHEMA, l.TABLE_NAME, l.COLUMN_NAME, null as DATA_TYPE, l.l, l.p from l where (p > 0 and l.TABLE_SCHEMA in (?)) order by l.TABLE_SCHEMA, l.TABLE_NAME, l.COLUMN_NAME, l.p");























        M_SOURCES.put(CLICKHOUSE, "select system.tables.database as catalog, system.tables.database, system.tables.table, system.tables.create_table_query from system.tables where (system.tables.database in (?) and system.tables.engine = 'View')");
        M_SOURCES.put(DERBY, "select cast(null as varchar(32672)) as catalog, SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSTABLES.TABLENAME, SYS.SYSVIEWS.VIEWDEFINITION from SYS.SYSTABLES join SYS.SYSSCHEMAS on SYS.SYSTABLES.SCHEMAID = SYS.SYSSCHEMAS.SCHEMAID left outer join SYS.SYSVIEWS on SYS.SYSTABLES.TABLEID = SYS.SYSVIEWS.TABLEID where cast(SYS.SYSSCHEMAS.SCHEMANAME as varchar(32672)) in (cast(? as varchar(32672))) order by SYS.SYSSCHEMAS.SCHEMANAME, SYS.SYSTABLES.TABLENAME");
        M_SOURCES.put(DUCKDB, "select duckdb_views.database_name, duckdb_views.schema_name, duckdb_views.view_name, duckdb_views.sql from duckdb_views() where duckdb_views.schema_name in (cast(? as varchar))");
        M_SOURCES.put(FIREBIRD, "select null catalog, null schema, trim(RDB$RELATIONS.RDB$RELATION_NAME), case when lower(RDB$RELATIONS.RDB$VIEW_SOURCE) like 'create%' then trim(RDB$RELATIONS.RDB$VIEW_SOURCE) else case when upper(substring(trim(RDB$RELATIONS.RDB$VIEW_SOURCE) from 1 for 1)) = substring(trim(RDB$RELATIONS.RDB$VIEW_SOURCE) from 1 for 1) then ((('CREATE VIEW \"' || trim(RDB$RELATIONS.RDB$RELATION_NAME)) || '\" AS ') || RDB$RELATIONS.RDB$VIEW_SOURCE) else ((('create view \"' || trim(RDB$RELATIONS.RDB$RELATION_NAME)) || '\" as ') || RDB$RELATIONS.RDB$VIEW_SOURCE) end end view_source from RDB$RELATIONS order by trim(RDB$RELATIONS.RDB$RELATION_NAME)");
        M_SOURCES.put(H2, "select INFORMATION_SCHEMA.VIEWS.TABLE_CATALOG, INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME, case when upper(substring(trim(INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION), 1, 1)) = substring(trim(INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION), 1, 1) then ('CREATE VIEW \"' || INFORMATION_SCHEMA.VIEWS.TABLE_NAME || '\" AS ' || INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION) else ('create view \"' || INFORMATION_SCHEMA.VIEWS.TABLE_NAME || '\" as ' || INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION) end VIEW_DEFINITION from INFORMATION_SCHEMA.VIEWS where INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA in (cast(? as varchar)) order by INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME");
        M_SOURCES.put(HSQLDB, "select INFORMATION_SCHEMA.VIEWS.TABLE_CATALOG, INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME, INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION from INFORMATION_SCHEMA.VIEWS where INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA in (cast(? as varchar(128))) order by INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME");
        M_SOURCES.put(MARIADB, "select information_schema.VIEWS.TABLE_CATALOG, information_schema.VIEWS.TABLE_SCHEMA, information_schema.VIEWS.TABLE_NAME, case when lower(information_schema.VIEWS.VIEW_DEFINITION) like 'create%' then information_schema.VIEWS.VIEW_DEFINITION else case when upper(substring(trim(information_schema.VIEWS.VIEW_DEFINITION), 1, 1)) = substring(trim(information_schema.VIEWS.VIEW_DEFINITION), 1, 1) then concat('CREATE VIEW `', information_schema.VIEWS.TABLE_NAME, '` AS ', information_schema.VIEWS.VIEW_DEFINITION) else concat('create view `', information_schema.VIEWS.TABLE_NAME, '` as ', information_schema.VIEWS.VIEW_DEFINITION) end end as VIEW_DEFINITION from information_schema.VIEWS where information_schema.VIEWS.TABLE_SCHEMA in (?) order by information_schema.VIEWS.TABLE_SCHEMA, information_schema.VIEWS.TABLE_NAME");
        M_SOURCES.put(MYSQL, "select information_schema.VIEWS.TABLE_CATALOG, information_schema.VIEWS.TABLE_SCHEMA, information_schema.VIEWS.TABLE_NAME, case when lower(information_schema.VIEWS.VIEW_DEFINITION) like 'create%' then information_schema.VIEWS.VIEW_DEFINITION else case when upper(substring(trim(information_schema.VIEWS.VIEW_DEFINITION), 1, 1)) = substring(trim(information_schema.VIEWS.VIEW_DEFINITION), 1, 1) then concat('CREATE VIEW `', information_schema.VIEWS.TABLE_NAME, '` AS ', information_schema.VIEWS.VIEW_DEFINITION) else concat('create view `', information_schema.VIEWS.TABLE_NAME, '` as ', information_schema.VIEWS.VIEW_DEFINITION) end end as VIEW_DEFINITION from information_schema.VIEWS where information_schema.VIEWS.TABLE_SCHEMA in (?) order by information_schema.VIEWS.TABLE_SCHEMA, information_schema.VIEWS.TABLE_NAME");
        M_SOURCES.put(POSTGRES, "select current_database(), alias_5049504.nspname, c.relname, case when c.relkind = 'm' then case when upper(substring(trim(pg_get_viewdef(c.oid)), 1, 1)) = substring(trim(pg_get_viewdef(c.oid)), 1, 1) then ('CREATE MATERIALIZED VIEW \"' || c.relname || '\" AS ' || pg_get_viewdef(c.oid)) else ('create materialized view \"' || c.relname || '\" as ' || pg_get_viewdef(c.oid)) end else case when upper(substring(trim(pg_get_viewdef(c.oid)), 1, 1)) = substring(trim(pg_get_viewdef(c.oid)), 1, 1) then ('CREATE VIEW \"' || c.relname || '\" AS ' || pg_get_viewdef(c.oid)) else ('create view \"' || c.relname || '\" as ' || pg_get_viewdef(c.oid)) end end as view_definition from (pg_catalog.pg_class as c join pg_catalog.pg_namespace as alias_5049504 on c.relnamespace = alias_5049504.oid) where (c.relkind in ('v', 'm') and alias_5049504.nspname in (?)) order by 1, 2, 3");
        M_SOURCES.put(SQLITE, "select null as catalog, null as schema, sqlite_master.name, sqlite_master.sql from sqlite_master order by sqlite_master.name");
        M_SOURCES.put(TRINO, "select '' TABLE_CATALOG, INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME, case when lower(INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION) like 'create%' then INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION else case when upper(substring(trim(INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION), 1, 1)) = substring(trim(INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION), 1, 1) then ((('CREATE VIEW \"' || INFORMATION_SCHEMA.VIEWS.TABLE_NAME) || '\" AS ') || INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION) else ((('create view \"' || INFORMATION_SCHEMA.VIEWS.TABLE_NAME) || '\" as ') || INFORMATION_SCHEMA.VIEWS.VIEW_DEFINITION) end end VIEW_DEFINITION from INFORMATION_SCHEMA.VIEWS where INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA in (?) order by INFORMATION_SCHEMA.VIEWS.TABLE_SCHEMA, INFORMATION_SCHEMA.VIEWS.TABLE_NAME");
        M_SOURCES.put(YUGABYTEDB, "select current_database(), alias_5049504.nspname, c.relname, case when c.relkind = 'm' then case when upper(substring(trim(pg_get_viewdef(c.oid)), 1, 1)) = substring(trim(pg_get_viewdef(c.oid)), 1, 1) then ('CREATE MATERIALIZED VIEW \"' || c.relname || '\" AS ' || pg_get_viewdef(c.oid)) else ('create materialized view \"' || c.relname || '\" as ' || pg_get_viewdef(c.oid)) end else case when upper(substring(trim(pg_get_viewdef(c.oid)), 1, 1)) = substring(trim(pg_get_viewdef(c.oid)), 1, 1) then ('CREATE VIEW \"' || c.relname || '\" AS ' || pg_get_viewdef(c.oid)) else ('create view \"' || c.relname || '\" as ' || pg_get_viewdef(c.oid)) end end as view_definition from (pg_catalog.pg_class as c join pg_catalog.pg_namespace as alias_5049504 on c.relnamespace = alias_5049504.oid) where (c.relkind in ('v', 'm') and alias_5049504.nspname in (?)) order by 1, 2, 3");

















































































        M_COMMENTS.put(CLICKHOUSE, "select c.catalog, c.database, c.table, c.name, c.comment from (select system.tables.database as catalog, system.tables.database, system.tables.name as table, null as name, system.tables.comment as comment from system.tables where system.tables.comment <> '' union all select system.columns.database as catalog, system.columns.database, system.columns.table, system.columns.name, system.columns.comment from system.columns where system.columns.comment <> '') c where c.database in (?) order by 1, 2, 3, 4");
        M_COMMENTS.put(DUCKDB, "select duckdb_tables.database_name, duckdb_tables.schema_name, duckdb_tables.table_name, duckdb_tables.column_name, duckdb_tables.comment from (select duckdb_tables.database_name, duckdb_tables.schema_name, duckdb_tables.table_name, null column_name, duckdb_tables.comment from duckdb_tables() union all select duckdb_views.database_name, duckdb_views.schema_name, duckdb_views.view_name, null column_name, duckdb_views.comment from duckdb_views() union all select duckdb_columns.database_name, duckdb_columns.schema_name, duckdb_columns.table_name, duckdb_columns.column_name, duckdb_columns.comment from duckdb_columns()) duckdb_tables where duckdb_tables.schema_name in (cast(? as varchar))");
        M_COMMENTS.put(FIREBIRD, "select c.catalog, c.schema, c.RDB$RELATION_NAME, c.RDB$FIELD_NAME, c.RDB$DESCRIPTION from (select null catalog, null schema, trim(RDB$RELATIONS.RDB$RELATION_NAME) RDB$RELATION_NAME, null RDB$FIELD_NAME, trim(RDB$RELATIONS.RDB$DESCRIPTION) RDB$DESCRIPTION from RDB$RELATIONS where RDB$RELATIONS.RDB$DESCRIPTION is not null union all select null, null, RDB$RELATION_FIELDS.RDB$RELATION_NAME, RDB$RELATION_FIELDS.RDB$FIELD_NAME, RDB$RELATION_FIELDS.RDB$DESCRIPTION from RDB$RELATION_FIELDS where RDB$RELATION_FIELDS.RDB$DESCRIPTION is not null) c order by 1, 2, 3");
        M_COMMENTS.put(H2, "select c.TABLE_CATALOG, c.TABLE_SCHEMA, c.TABLE_NAME, c.COLUMN_NAME, c.REMARKS from (select INFORMATION_SCHEMA.TABLES.TABLE_CATALOG, INFORMATION_SCHEMA.TABLES.TABLE_SCHEMA, INFORMATION_SCHEMA.TABLES.TABLE_NAME, null COLUMN_NAME, INFORMATION_SCHEMA.TABLES.REMARKS from INFORMATION_SCHEMA.TABLES where INFORMATION_SCHEMA.TABLES.REMARKS is not null union all select INFORMATION_SCHEMA.COLUMNS.TABLE_CATALOG, INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA, INFORMATION_SCHEMA.COLUMNS.TABLE_NAME, INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, INFORMATION_SCHEMA.COLUMNS.REMARKS from INFORMATION_SCHEMA.COLUMNS where INFORMATION_SCHEMA.COLUMNS.REMARKS is not null) c where c.TABLE_SCHEMA in (cast(? as varchar)) order by 1, 2, 3, 4");
        M_COMMENTS.put(HSQLDB, "select c.TABLE_CAT, c.TABLE_SCHEM, c.TABLE_NAME, c.COLUMN_NAME, c.REMARKS from (select INFORMATION_SCHEMA.SYSTEM_TABLES.TABLE_CAT, INFORMATION_SCHEMA.SYSTEM_TABLES.TABLE_SCHEM, INFORMATION_SCHEMA.SYSTEM_TABLES.TABLE_NAME, null as COLUMN_NAME, INFORMATION_SCHEMA.SYSTEM_TABLES.REMARKS from INFORMATION_SCHEMA.SYSTEM_TABLES where INFORMATION_SCHEMA.SYSTEM_TABLES.REMARKS is not null union all select INFORMATION_SCHEMA.COLUMNS.TABLE_CATALOG, INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA, INFORMATION_SCHEMA.COLUMNS.TABLE_NAME, INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME, INFORMATION_SCHEMA.SYSTEM_COLUMNS.REMARKS from INFORMATION_SCHEMA.COLUMNS join INFORMATION_SCHEMA.SYSTEM_COLUMNS on (INFORMATION_SCHEMA.COLUMNS.TABLE_CATALOG = INFORMATION_SCHEMA.SYSTEM_COLUMNS.TABLE_CAT and INFORMATION_SCHEMA.COLUMNS.TABLE_SCHEMA = INFORMATION_SCHEMA.SYSTEM_COLUMNS.TABLE_SCHEM and INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = INFORMATION_SCHEMA.SYSTEM_COLUMNS.TABLE_NAME and INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME = INFORMATION_SCHEMA.SYSTEM_COLUMNS.COLUMN_NAME) where INFORMATION_SCHEMA.SYSTEM_COLUMNS.REMARKS is not null) as c where c.TABLE_SCHEM in (cast(? as varchar(128))) order by 1, 2, 3, 4");
        M_COMMENTS.put(POSTGRES, "select current_database() as catalog_name, c.schema_name, c.table_name, c.column_name, c.remarks from (select alias_87241969.nspname as schema_name, pg_catalog.pg_class.relname as table_name, null as column_name, obj_description(pg_catalog.pg_class.oid, 'pg_class') as remarks from (pg_catalog.pg_class join pg_catalog.pg_namespace as alias_87241969 on pg_catalog.pg_class.relnamespace = alias_87241969.oid) where obj_description(pg_catalog.pg_class.oid, 'pg_class') is not null union all select pg_catalog.pg_namespace.nspname, null, null, obj_description(pg_catalog.pg_namespace.oid, 'pg_namespace') as remarks from pg_catalog.pg_namespace where obj_description(pg_catalog.pg_namespace.oid, 'pg_namespace') is not null union all select alias_120026365.nspname, pg_catalog.pg_proc.proname, null, obj_description(pg_catalog.pg_proc.oid, 'pg_proc') as remarks from (pg_catalog.pg_proc join pg_catalog.pg_namespace as alias_120026365 on pg_catalog.pg_proc.pronamespace = alias_120026365.oid) where obj_description(pg_catalog.pg_proc.oid, 'pg_proc') is not null union all select alias_42996861.nspname, pg_catalog.pg_type.typname, null, obj_description(pg_catalog.pg_type.oid, 'pg_type') as remarks from (pg_catalog.pg_type join pg_catalog.pg_namespace as alias_42996861 on pg_catalog.pg_type.typnamespace = alias_42996861.oid) where obj_description(pg_catalog.pg_type.oid, 'pg_type') is not null) as c where c.schema_name in (?) order by 1, 2, 3, 4");
        M_COMMENTS.put(YUGABYTEDB, "select current_database() as catalog_name, c.schema_name, c.table_name, c.column_name, c.remarks from (select alias_87241969.nspname as schema_name, pg_catalog.pg_class.relname as table_name, null as column_name, obj_description(pg_catalog.pg_class.oid, 'pg_class') as remarks from (pg_catalog.pg_class join pg_catalog.pg_namespace as alias_87241969 on pg_catalog.pg_class.relnamespace = alias_87241969.oid) where obj_description(pg_catalog.pg_class.oid, 'pg_class') is not null union all select pg_catalog.pg_namespace.nspname, null, null, obj_description(pg_catalog.pg_namespace.oid, 'pg_namespace') as remarks from pg_catalog.pg_namespace where obj_description(pg_catalog.pg_namespace.oid, 'pg_namespace') is not null union all select alias_120026365.nspname, pg_catalog.pg_proc.proname, null, obj_description(pg_catalog.pg_proc.oid, 'pg_proc') as remarks from (pg_catalog.pg_proc join pg_catalog.pg_namespace as alias_120026365 on pg_catalog.pg_proc.pronamespace = alias_120026365.oid) where obj_description(pg_catalog.pg_proc.oid, 'pg_proc') is not null union all select alias_42996861.nspname, pg_catalog.pg_type.typname, null, obj_description(pg_catalog.pg_type.oid, 'pg_type') as remarks from (pg_catalog.pg_type join pg_catalog.pg_namespace as alias_42996861 on pg_catalog.pg_type.typnamespace = alias_42996861.oid) where obj_description(pg_catalog.pg_type.oid, 'pg_type') is not null) as c where c.schema_name in (?) order by 1, 2, 3, 4");


















































        M_GENERATORS.put(MARIADB, "select null as table_catalog, information_schema.COLUMNS.TABLE_SCHEMA, information_schema.COLUMNS.TABLE_NAME, information_schema.COLUMNS.COLUMN_NAME, information_schema.COLUMNS.GENERATION_EXPRESSION, case when information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED') then 'VIRTUAL' when information_schema.COLUMNS.EXTRA in ('PERSISTENT', 'STORED GENERATED') then 'STORED' end as generationOption from information_schema.COLUMNS where (information_schema.COLUMNS.TABLE_SCHEMA in (?) and information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED', 'PERSISTENT', 'STORED GENERATED')) order by information_schema.COLUMNS.ORDINAL_POSITION");
        M_GENERATORS.put(MYSQL, "select null as table_catalog, information_schema.COLUMNS.TABLE_SCHEMA, information_schema.COLUMNS.TABLE_NAME, information_schema.COLUMNS.COLUMN_NAME, information_schema.COLUMNS.GENERATION_EXPRESSION, case when information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED') then 'VIRTUAL' when information_schema.COLUMNS.EXTRA in ('PERSISTENT', 'STORED GENERATED') then 'STORED' end as generationOption from information_schema.COLUMNS where (information_schema.COLUMNS.TABLE_SCHEMA in (?) and information_schema.COLUMNS.EXTRA in ('VIRTUAL', 'VIRTUAL GENERATED', 'PERSISTENT', 'STORED GENERATED')) order by information_schema.COLUMNS.ORDINAL_POSITION");





























































































































    }
}
