/*
 * This file is generated by jOOQ.
 */
package org.jooq.meta.duckdb.system.main.tables;


import org.jooq.Field;
import org.jooq.ForeignKey;
import org.jooq.Name;
import org.jooq.Record;
import org.jooq.Schema;
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;
import org.jooq.meta.duckdb.system.main.Main;


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

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>system.main.duckdb_views</code>
     */
    public static final DuckdbViews DUCKDB_VIEWS = new DuckdbViews();

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

    /**
     * The column <code>system.main.duckdb_views.database_name</code>.
     */
    public final TableField<Record, String> DATABASE_NAME = createField(DSL.name("database_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>system.main.duckdb_views.database_oid</code>.
     */
    public final TableField<Record, Long> DATABASE_OID = createField(DSL.name("database_oid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>system.main.duckdb_views.schema_name</code>.
     */
    public final TableField<Record, String> SCHEMA_NAME = createField(DSL.name("schema_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>system.main.duckdb_views.schema_oid</code>.
     */
    public final TableField<Record, Long> SCHEMA_OID = createField(DSL.name("schema_oid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>system.main.duckdb_views.view_name</code>.
     */
    public final TableField<Record, String> VIEW_NAME = createField(DSL.name("view_name"), SQLDataType.VARCHAR, this, "");

    /**
     * The column <code>system.main.duckdb_views.view_oid</code>.
     */
    public final TableField<Record, Long> VIEW_OID = createField(DSL.name("view_oid"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>system.main.duckdb_views.internal</code>.
     */
    public final TableField<Record, Boolean> INTERNAL = createField(DSL.name("internal"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>system.main.duckdb_views.temporary</code>.
     */
    public final TableField<Record, Boolean> TEMPORARY = createField(DSL.name("temporary"), SQLDataType.BOOLEAN, this, "");

    /**
     * The column <code>system.main.duckdb_views.column_count</code>.
     */
    public final TableField<Record, Long> COLUMN_COUNT = createField(DSL.name("column_count"), SQLDataType.BIGINT, this, "");

    /**
     * The column <code>system.main.duckdb_views.sql</code>.
     */
    public final TableField<Record, String> SQL = createField(DSL.name("sql"), SQLDataType.VARCHAR, this, "");

    private DuckdbViews(Name alias, Table<Record> aliased) {
        this(alias, aliased, null);
    }

    private DuckdbViews(Name alias, Table<Record> aliased, Field<?>[] parameters) {
        super(alias, null, aliased, parameters, DSL.comment(""), TableOptions.view());
    }

    /**
     * Create an aliased <code>system.main.duckdb_views</code> table reference
     */
    public DuckdbViews(String alias) {
        this(DSL.name(alias), DUCKDB_VIEWS);
    }

    /**
     * Create an aliased <code>system.main.duckdb_views</code> table reference
     */
    public DuckdbViews(Name alias) {
        this(alias, DUCKDB_VIEWS);
    }

    /**
     * Create a <code>system.main.duckdb_views</code> table reference
     */
    public DuckdbViews() {
        this(DSL.name("duckdb_views"), null);
    }

    public <O extends Record> DuckdbViews(Table<O> child, ForeignKey<O, Record> key) {
        super(child, key, DUCKDB_VIEWS);
    }

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

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

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

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

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

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

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