/*
 * This file is generated by jOOQ.
 */
package ervu_secret.ervu_secret.db_beans.pg_catalog.tables;


import ervu_secret.ervu_secret.db_beans.pg_catalog.Keys;
import ervu_secret.ervu_secret.db_beans.pg_catalog.PgCatalog;
import ervu_secret.ervu_secret.db_beans.pg_catalog.tables.records.PgDatabaseRecord;

import java.util.Arrays;
import java.util.Collection;
import java.util.List;

import org.jooq.Condition;
import org.jooq.Field;
import org.jooq.Name;
import org.jooq.PlainSQL;
import org.jooq.QueryPart;
import org.jooq.SQL;
import org.jooq.Schema;
import org.jooq.Select;
import org.jooq.Stringly;
import org.jooq.Table;
import org.jooq.TableField;
import org.jooq.TableOptions;
import org.jooq.UniqueKey;
import org.jooq.impl.DSL;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


/**
 * This class is generated by jOOQ.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class PgDatabase extends TableImpl<PgDatabaseRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_database</code>
     */
    public static final PgDatabase PG_DATABASE = new PgDatabase();

    /**
     * The class holding records for this type
     */
    @Override
    public Class<PgDatabaseRecord> getRecordType() {
        return PgDatabaseRecord.class;
    }

    /**
     * The column <code>pg_catalog.pg_database.oid</code>.
     */
    public final TableField<PgDatabaseRecord, Long> OID = createField(DSL.name("oid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datname</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATNAME = createField(DSL.name("datname"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datdba</code>.
     */
    public final TableField<PgDatabaseRecord, Long> DATDBA = createField(DSL.name("datdba"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.encoding</code>.
     */
    public final TableField<PgDatabaseRecord, Integer> ENCODING = createField(DSL.name("encoding"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datlocprovider</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATLOCPROVIDER = createField(DSL.name("datlocprovider"), SQLDataType.CHAR.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datistemplate</code>.
     */
    public final TableField<PgDatabaseRecord, Boolean> DATISTEMPLATE = createField(DSL.name("datistemplate"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datallowconn</code>.
     */
    public final TableField<PgDatabaseRecord, Boolean> DATALLOWCONN = createField(DSL.name("datallowconn"), SQLDataType.BOOLEAN.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datconnlimit</code>.
     */
    public final TableField<PgDatabaseRecord, Integer> DATCONNLIMIT = createField(DSL.name("datconnlimit"), SQLDataType.INTEGER.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datfrozenxid</code>.
     */
    public final TableField<PgDatabaseRecord, Long> DATFROZENXID = createField(DSL.name("datfrozenxid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datminmxid</code>.
     */
    public final TableField<PgDatabaseRecord, Long> DATMINMXID = createField(DSL.name("datminmxid"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.dattablespace</code>.
     */
    public final TableField<PgDatabaseRecord, Long> DATTABLESPACE = createField(DSL.name("dattablespace"), SQLDataType.BIGINT.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datcollate</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATCOLLATE = createField(DSL.name("datcollate"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.datctype</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATCTYPE = createField(DSL.name("datctype"), SQLDataType.CLOB.nullable(false), this, "");

    /**
     * The column <code>pg_catalog.pg_database.daticulocale</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATICULOCALE = createField(DSL.name("daticulocale"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_database.datcollversion</code>.
     */
    public final TableField<PgDatabaseRecord, String> DATCOLLVERSION = createField(DSL.name("datcollversion"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_database.datacl</code>.
     */
    public final TableField<PgDatabaseRecord, String[]> DATACL = createField(DSL.name("datacl"), SQLDataType.VARCHAR.array(), this, "");

    private PgDatabase(Name alias, Table<PgDatabaseRecord> aliased) {
        this(alias, aliased, (Field<?>[]) null, null);
    }

    private PgDatabase(Name alias, Table<PgDatabaseRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.table(), where);
    }

    /**
     * Create an aliased <code>pg_catalog.pg_database</code> table reference
     */
    public PgDatabase(String alias) {
        this(DSL.name(alias), PG_DATABASE);
    }

    /**
     * Create an aliased <code>pg_catalog.pg_database</code> table reference
     */
    public PgDatabase(Name alias) {
        this(alias, PG_DATABASE);
    }

    /**
     * Create a <code>pg_catalog.pg_database</code> table reference
     */
    public PgDatabase() {
        this(DSL.name("pg_database"), null);
    }

    @Override
    public Schema getSchema() {
        return aliased() ? null : PgCatalog.PG_CATALOG;
    }

    @Override
    public UniqueKey<PgDatabaseRecord> getPrimaryKey() {
        return Keys.PG_DATABASE_OID_INDEX;
    }

    @Override
    public List<UniqueKey<PgDatabaseRecord>> getUniqueKeys() {
        return Arrays.asList(Keys.PG_DATABASE_DATNAME_INDEX);
    }

    @Override
    public PgDatabase as(String alias) {
        return new PgDatabase(DSL.name(alias), this);
    }

    @Override
    public PgDatabase as(Name alias) {
        return new PgDatabase(alias, this);
    }

    @Override
    public PgDatabase as(Table<?> alias) {
        return new PgDatabase(alias.getQualifiedName(), this);
    }

    /**
     * Rename this table
     */
    @Override
    public PgDatabase rename(String name) {
        return new PgDatabase(DSL.name(name), null);
    }

    /**
     * Rename this table
     */
    @Override
    public PgDatabase rename(Name name) {
        return new PgDatabase(name, null);
    }

    /**
     * Rename this table
     */
    @Override
    public PgDatabase rename(Table<?> name) {
        return new PgDatabase(name.getQualifiedName(), null);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase where(Condition condition) {
        return new PgDatabase(getQualifiedName(), aliased() ? this : null, null, condition);
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase where(Collection<? extends Condition> conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase where(Condition... conditions) {
        return where(DSL.and(conditions));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase where(Field<Boolean> condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public PgDatabase where(SQL condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public PgDatabase where(@Stringly.SQL String condition) {
        return where(DSL.condition(condition));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public PgDatabase where(@Stringly.SQL String condition, Object... binds) {
        return where(DSL.condition(condition, binds));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    @PlainSQL
    public PgDatabase where(@Stringly.SQL String condition, QueryPart... parts) {
        return where(DSL.condition(condition, parts));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase whereExists(Select<?> select) {
        return where(DSL.exists(select));
    }

    /**
     * Create an inline derived table from this table
     */
    @Override
    public PgDatabase whereNotExists(Select<?> select) {
        return where(DSL.notExists(select));
    }
}
