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


import org.jooq.Condition;
import org.jooq.Field;
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.clickhouse.system.System;
import org.jooq.types.UByte;
import org.jooq.types.ULong;


/**
 * Lists all columns from all tables of the current server.
 */
@SuppressWarnings({ "all", "unchecked", "rawtypes", "this-escape" })
public class Columns extends TableImpl<Record> {

    private static final long serialVersionUID = 1L;

    /**
     * The reference instance of <code>system.columns</code>
     */
    public static final Columns COLUMNS = new Columns();

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

    /**
     * The column <code>system.columns.database</code>.
     */
    public final TableField<Record, String> DATABASE = createField(DSL.name("database"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.table</code>.
     */
    public final TableField<Record, String> TABLE = createField(DSL.name("table"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.name</code>.
     */
    public final TableField<Record, String> NAME = createField(DSL.name("name"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.type</code>.
     */
    public final TableField<Record, String> TYPE = createField(DSL.name("type"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.position</code>.
     */
    public final TableField<Record, ULong> POSITION = createField(DSL.name("position"), SQLDataType.BIGINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.default_kind</code>.
     */
    public final TableField<Record, String> DEFAULT_KIND = createField(DSL.name("default_kind"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.default_expression</code>.
     */
    public final TableField<Record, String> DEFAULT_EXPRESSION = createField(DSL.name("default_expression"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.data_compressed_bytes</code>.
     */
    public final TableField<Record, ULong> DATA_COMPRESSED_BYTES = createField(DSL.name("data_compressed_bytes"), SQLDataType.BIGINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.data_uncompressed_bytes</code>.
     */
    public final TableField<Record, ULong> DATA_UNCOMPRESSED_BYTES = createField(DSL.name("data_uncompressed_bytes"), SQLDataType.BIGINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.marks_bytes</code>.
     */
    public final TableField<Record, ULong> MARKS_BYTES = createField(DSL.name("marks_bytes"), SQLDataType.BIGINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.comment</code>.
     */
    public final TableField<Record, String> COMMENT = createField(DSL.name("comment"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.is_in_partition_key</code>.
     */
    public final TableField<Record, UByte> IS_IN_PARTITION_KEY = createField(DSL.name("is_in_partition_key"), SQLDataType.TINYINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.is_in_sorting_key</code>.
     */
    public final TableField<Record, UByte> IS_IN_SORTING_KEY = createField(DSL.name("is_in_sorting_key"), SQLDataType.TINYINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.is_in_primary_key</code>.
     */
    public final TableField<Record, UByte> IS_IN_PRIMARY_KEY = createField(DSL.name("is_in_primary_key"), SQLDataType.TINYINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.is_in_sampling_key</code>.
     */
    public final TableField<Record, UByte> IS_IN_SAMPLING_KEY = createField(DSL.name("is_in_sampling_key"), SQLDataType.TINYINTUNSIGNED.nullable(false), this, "");

    /**
     * The column <code>system.columns.compression_codec</code>.
     */
    public final TableField<Record, String> COMPRESSION_CODEC = createField(DSL.name("compression_codec"), SQLDataType.VARCHAR.nullable(false), this, "");

    /**
     * The column <code>system.columns.character_octet_length</code>.
     */
    public final TableField<Record, ULong> CHARACTER_OCTET_LENGTH = createField(DSL.name("character_octet_length"), SQLDataType.BIGINTUNSIGNED, this, "");

    /**
     * The column <code>system.columns.numeric_precision</code>.
     */
    public final TableField<Record, ULong> NUMERIC_PRECISION = createField(DSL.name("numeric_precision"), SQLDataType.BIGINTUNSIGNED, this, "");

    /**
     * The column <code>system.columns.numeric_precision_radix</code>.
     */
    public final TableField<Record, ULong> NUMERIC_PRECISION_RADIX = createField(DSL.name("numeric_precision_radix"), SQLDataType.BIGINTUNSIGNED, this, "");

    /**
     * The column <code>system.columns.numeric_scale</code>.
     */
    public final TableField<Record, ULong> NUMERIC_SCALE = createField(DSL.name("numeric_scale"), SQLDataType.BIGINTUNSIGNED, this, "");

    /**
     * The column <code>system.columns.datetime_precision</code>.
     */
    public final TableField<Record, ULong> DATETIME_PRECISION = createField(DSL.name("datetime_precision"), SQLDataType.BIGINTUNSIGNED, this, "");

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

    private Columns(Name alias, Table<Record> aliased, Field<?>[] parameters, Condition where) {
        super(alias, null, aliased, parameters, DSL.comment("Lists all columns from all tables of the current server."), TableOptions.view(), where);
    }

    /**
     * Create an aliased <code>system.columns</code> table reference
     */
    public Columns(String alias) {
        this(DSL.name(alias), COLUMNS);
    }

    /**
     * Create an aliased <code>system.columns</code> table reference
     */
    public Columns(Name alias) {
        this(alias, COLUMNS);
    }

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

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

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

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

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