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

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


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_archiver</code>
     */
    public static final PgStatArchiver PG_STAT_ARCHIVER = new PgStatArchiver();

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

    /**
     * The column <code>pg_catalog.pg_stat_archiver.archived_count</code>.
     */
    public final TableField<PgStatArchiverRecord, Long> ARCHIVED_COUNT = createField(DSL.name("archived_count"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.last_archived_wal</code>.
     */
    public final TableField<PgStatArchiverRecord, String> LAST_ARCHIVED_WAL = createField(DSL.name("last_archived_wal"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.last_archived_time</code>.
     */
    public final TableField<PgStatArchiverRecord, Timestamp> LAST_ARCHIVED_TIME = createField(DSL.name("last_archived_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.failed_count</code>.
     */
    public final TableField<PgStatArchiverRecord, Long> FAILED_COUNT = createField(DSL.name("failed_count"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.last_failed_wal</code>.
     */
    public final TableField<PgStatArchiverRecord, String> LAST_FAILED_WAL = createField(DSL.name("last_failed_wal"), SQLDataType.CLOB, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.last_failed_time</code>.
     */
    public final TableField<PgStatArchiverRecord, Timestamp> LAST_FAILED_TIME = createField(DSL.name("last_failed_time"), SQLDataType.TIMESTAMP(0), this, "");

    /**
     * The column <code>pg_catalog.pg_stat_archiver.stats_reset</code>.
     */
    public final TableField<PgStatArchiverRecord, Timestamp> STATS_RESET = createField(DSL.name("stats_reset"), SQLDataType.TIMESTAMP(0), this, "");

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

    private PgStatArchiver(Name alias, Table<PgStatArchiverRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_archiver" as  SELECT s.archived_count,
         s.last_archived_wal,
         s.last_archived_time,
         s.failed_count,
         s.last_failed_wal,
         s.last_failed_time,
         s.stats_reset
        FROM pg_stat_get_archiver() s(archived_count, last_archived_wal, last_archived_time, failed_count, last_failed_wal, last_failed_time, stats_reset);
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_archiver</code> table
     * reference
     */
    public PgStatArchiver(Name alias) {
        this(alias, PG_STAT_ARCHIVER);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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