/*
 * 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.PgStatWalReceiverRecord;

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 PgStatWalReceiver extends TableImpl<PgStatWalReceiverRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_wal_receiver</code>
     */
    public static final PgStatWalReceiver PG_STAT_WAL_RECEIVER = new PgStatWalReceiver();

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

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.pid</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Integer> PID = createField(DSL.name("pid"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.status</code>.
     */
    public final TableField<PgStatWalReceiverRecord, String> STATUS = createField(DSL.name("status"), SQLDataType.CLOB, this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatWalReceiverRecord, Object> RECEIVE_START_LSN = createField(DSL.name("receive_start_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_wal_receiver.receive_start_tli</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Integer> RECEIVE_START_TLI = createField(DSL.name("receive_start_tli"), SQLDataType.INTEGER, this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatWalReceiverRecord, Object> WRITTEN_LSN = createField(DSL.name("written_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatWalReceiverRecord, Object> FLUSHED_LSN = createField(DSL.name("flushed_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.received_tli</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Integer> RECEIVED_TLI = createField(DSL.name("received_tli"), SQLDataType.INTEGER, this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_wal_receiver.last_msg_send_time</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Timestamp> LAST_MSG_SEND_TIME = createField(DSL.name("last_msg_send_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column
     * <code>pg_catalog.pg_stat_wal_receiver.last_msg_receipt_time</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Timestamp> LAST_MSG_RECEIPT_TIME = createField(DSL.name("last_msg_receipt_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * @deprecated Unknown data type. If this is a qualified, user-defined type,
     * it may have been excluded from code generation. If this is a built-in
     * type, you can define an explicit {@link org.jooq.Binding} to specify how
     * this type should be handled. Deprecation can be turned off using
     * {@literal <deprecationOnUnknownTypes/>} in your code generator
     * configuration.
     */
    @Deprecated
    public final TableField<PgStatWalReceiverRecord, Object> LATEST_END_LSN = createField(DSL.name("latest_end_lsn"), DefaultDataType.getDefaultDataType("\"pg_catalog\".\"pg_lsn\""), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.latest_end_time</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Timestamp> LATEST_END_TIME = createField(DSL.name("latest_end_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.slot_name</code>.
     */
    public final TableField<PgStatWalReceiverRecord, String> SLOT_NAME = createField(DSL.name("slot_name"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.sender_host</code>.
     */
    public final TableField<PgStatWalReceiverRecord, String> SENDER_HOST = createField(DSL.name("sender_host"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.sender_port</code>.
     */
    public final TableField<PgStatWalReceiverRecord, Integer> SENDER_PORT = createField(DSL.name("sender_port"), SQLDataType.INTEGER, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal_receiver.conninfo</code>.
     */
    public final TableField<PgStatWalReceiverRecord, String> CONNINFO = createField(DSL.name("conninfo"), SQLDataType.CLOB, this, "");

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

    private PgStatWalReceiver(Name alias, Table<PgStatWalReceiverRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_wal_receiver" as  SELECT s.pid,
          s.status,
          s.receive_start_lsn,
          s.receive_start_tli,
          s.written_lsn,
          s.flushed_lsn,
          s.received_tli,
          s.last_msg_send_time,
          s.last_msg_receipt_time,
          s.latest_end_lsn,
          s.latest_end_time,
          s.slot_name,
          s.sender_host,
          s.sender_port,
          s.conninfo
         FROM pg_stat_get_wal_receiver() s(pid, status, receive_start_lsn, receive_start_tli, written_lsn, flushed_lsn, received_tli, last_msg_send_time, last_msg_receipt_time, latest_end_lsn, latest_end_time, slot_name, sender_host, sender_port, conninfo)
        WHERE (s.pid IS NOT NULL);
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_wal_receiver</code> table
     * reference
     */
    public PgStatWalReceiver(Name alias) {
        this(alias, PG_STAT_WAL_RECEIVER);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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