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

import java.math.BigDecimal;
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 PgStatWal extends TableImpl<PgStatWalRecord> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>pg_catalog.pg_stat_wal</code>
     */
    public static final PgStatWal PG_STAT_WAL = new PgStatWal();

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

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_records</code>.
     */
    public final TableField<PgStatWalRecord, Long> WAL_RECORDS = createField(DSL.name("wal_records"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_fpi</code>.
     */
    public final TableField<PgStatWalRecord, Long> WAL_FPI = createField(DSL.name("wal_fpi"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_bytes</code>.
     */
    public final TableField<PgStatWalRecord, BigDecimal> WAL_BYTES = createField(DSL.name("wal_bytes"), SQLDataType.NUMERIC, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_buffers_full</code>.
     */
    public final TableField<PgStatWalRecord, Long> WAL_BUFFERS_FULL = createField(DSL.name("wal_buffers_full"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_write</code>.
     */
    public final TableField<PgStatWalRecord, Long> WAL_WRITE = createField(DSL.name("wal_write"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_sync</code>.
     */
    public final TableField<PgStatWalRecord, Long> WAL_SYNC = createField(DSL.name("wal_sync"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_write_time</code>.
     */
    public final TableField<PgStatWalRecord, Double> WAL_WRITE_TIME = createField(DSL.name("wal_write_time"), SQLDataType.DOUBLE, this, "");

    /**
     * The column <code>pg_catalog.pg_stat_wal.wal_sync_time</code>.
     */
    public final TableField<PgStatWalRecord, Double> WAL_SYNC_TIME = createField(DSL.name("wal_sync_time"), SQLDataType.DOUBLE, this, "");

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

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

    private PgStatWal(Name alias, Table<PgStatWalRecord> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view("""
        create view "pg_stat_wal" as  SELECT w.wal_records,
         w.wal_fpi,
         w.wal_bytes,
         w.wal_buffers_full,
         w.wal_write,
         w.wal_sync,
         w.wal_write_time,
         w.wal_sync_time,
         w.stats_reset
        FROM pg_stat_get_wal() w(wal_records, wal_fpi, wal_bytes, wal_buffers_full, wal_write, wal_sync, wal_write_time, wal_sync_time, stats_reset);
        """), where);
    }

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

    /**
     * Create an aliased <code>pg_catalog.pg_stat_wal</code> table reference
     */
    public PgStatWal(Name alias) {
        this(alias, PG_STAT_WAL);
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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