/*
 * 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.PgCatalog;
import ervu_secret.ervu_secret.db_beans.pg_catalog.tables.records.PgPreparedStatementsRecord;

import java.sql.Timestamp;
import java.util.Collection;

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.impl.DSL;
import org.jooq.impl.DefaultDataType;
import org.jooq.impl.SQLDataType;
import org.jooq.impl.TableImpl;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_prepared_statements</code>
     */
    public static final PgPreparedStatements PG_PREPARED_STATEMENTS = new PgPreparedStatements();

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

    /**
     * The column <code>pg_catalog.pg_prepared_statements.name</code>.
     */
    public final TableField<PgPreparedStatementsRecord, String> NAME = createField(DSL.name("name"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_statements.statement</code>.
     */
    public final TableField<PgPreparedStatementsRecord, String> STATEMENT = createField(DSL.name("statement"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_statements.prepare_time</code>.
     */
    public final TableField<PgPreparedStatementsRecord, Timestamp> PREPARE_TIME = createField(DSL.name("prepare_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column
     * <code>pg_catalog.pg_prepared_statements.parameter_types</code>.
     */
    public final TableField<PgPreparedStatementsRecord, Object[]> PARAMETER_TYPES = createField(DSL.name("parameter_types"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"regtype\"").array(), this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_statements.from_sql</code>.
     */
    public final TableField<PgPreparedStatementsRecord, Boolean> FROM_SQL = createField(DSL.name("from_sql"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_statements.generic_plans</code>.
     */
    public final TableField<PgPreparedStatementsRecord, Long> GENERIC_PLANS = createField(DSL.name("generic_plans"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_prepared_statements.custom_plans</code>.
     */
    public final TableField<PgPreparedStatementsRecord, Long> CUSTOM_PLANS = createField(DSL.name("custom_plans"), SQLDataType.BIGINT, this, "");

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

    private PgPreparedStatements(Name alias, Table<PgPreparedStatementsRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_prepared_statements" as  SELECT p.name,
         p.statement,
         p.prepare_time,
         p.parameter_types,
         p.from_sql,
         p.generic_plans,
         p.custom_plans
        FROM pg_prepared_statement() p(name, statement, prepare_time, parameter_types, from_sql, generic_plans, custom_plans);
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_prepared_statements</code> table
     * reference
     */
    public PgPreparedStatements(Name alias) {
        this(alias, PG_PREPARED_STATEMENTS);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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