/*
 * This file is generated by jOOQ.
 */
package com.nisemoe.generated.tables


import com.nisemoe.generated.Public
import com.nisemoe.generated.tables.records.UserScoresRecord

import java.time.OffsetDateTime
import java.util.UUID

import kotlin.collections.List

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


/**
 * This class is generated by jOOQ.
 */
@Suppress("UNCHECKED_CAST")
open class UserScores(
    alias: Name,
    child: Table<out Record>?,
    path: ForeignKey<out Record, UserScoresRecord>?,
    aliased: Table<UserScoresRecord>?,
    parameters: Array<Field<*>?>?
): TableImpl<UserScoresRecord>(
    alias,
    Public.PUBLIC,
    child,
    path,
    aliased,
    parameters,
    DSL.comment(""),
    TableOptions.table()
) {
    companion object {

        /**
         * The reference instance of <code>public.user_scores</code>
         */
        val USER_SCORES: UserScores = UserScores()
    }

    /**
     * The class holding records for this type
     */
    override fun getRecordType(): Class<UserScoresRecord> = UserScoresRecord::class.java

    /**
     * The column <code>public.user_scores.id</code>.
     */
    val ID: TableField<UserScoresRecord, UUID?> = createField(DSL.name("id"), SQLDataType.UUID.nullable(false).defaultValue(DSL.field(DSL.raw("gen_random_uuid()"), SQLDataType.UUID)), this, "")

    /**
     * The column <code>public.user_scores.added_at</code>.
     */
    val ADDED_AT: TableField<UserScoresRecord, OffsetDateTime?> = createField(DSL.name("added_at"), SQLDataType.TIMESTAMPWITHTIMEZONE(6).defaultValue(DSL.field(DSL.raw("CURRENT_TIMESTAMP"), SQLDataType.TIMESTAMPWITHTIMEZONE)), this, "")

    /**
     * The column <code>public.user_scores.beatmap_id</code>.
     */
    val BEATMAP_ID: TableField<UserScoresRecord, Int?> = createField(DSL.name("beatmap_id"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.beatmap_hash</code>.
     */
    val BEATMAP_HASH: TableField<UserScoresRecord, String?> = createField(DSL.name("beatmap_hash"), SQLDataType.VARCHAR(32), this, "")

    /**
     * The column <code>public.user_scores.game_mode</code>.
     */
    val GAME_MODE: TableField<UserScoresRecord, Int?> = createField(DSL.name("game_mode"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.game_version</code>.
     */
    val GAME_VERSION: TableField<UserScoresRecord, Int?> = createField(DSL.name("game_version"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.player_name</code>.
     */
    val PLAYER_NAME: TableField<UserScoresRecord, String?> = createField(DSL.name("player_name"), SQLDataType.VARCHAR(256), this, "")

    /**
     * The column <code>public.user_scores.replay_hash</code>.
     */
    val REPLAY_HASH: TableField<UserScoresRecord, String?> = createField(DSL.name("replay_hash"), SQLDataType.VARCHAR(32), this, "")

    /**
     * The column <code>public.user_scores.count_300</code>.
     */
    val COUNT_300: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_300"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.count_100</code>.
     */
    val COUNT_100: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_100"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.count_50</code>.
     */
    val COUNT_50: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_50"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.count_geki</code>.
     */
    val COUNT_GEKI: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_geki"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.count_katu</code>.
     */
    val COUNT_KATU: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_katu"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.count_miss</code>.
     */
    val COUNT_MISS: TableField<UserScoresRecord, Short?> = createField(DSL.name("count_miss"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.total_score</code>.
     */
    val TOTAL_SCORE: TableField<UserScoresRecord, Int?> = createField(DSL.name("total_score"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.max_combo</code>.
     */
    val MAX_COMBO: TableField<UserScoresRecord, Short?> = createField(DSL.name("max_combo"), SQLDataType.SMALLINT, this, "")

    /**
     * The column <code>public.user_scores.perfect</code>.
     */
    val PERFECT: TableField<UserScoresRecord, Boolean?> = createField(DSL.name("perfect"), SQLDataType.BOOLEAN, this, "")

    /**
     * The column <code>public.user_scores.mods</code>.
     */
    val MODS: TableField<UserScoresRecord, Int?> = createField(DSL.name("mods"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.life_bar_graph</code>.
     */
    val LIFE_BAR_GRAPH: TableField<UserScoresRecord, String?> = createField(DSL.name("life_bar_graph"), SQLDataType.CLOB, this, "")

    /**
     * The column <code>public.user_scores.timestamp</code>.
     */
    val TIMESTAMP: TableField<UserScoresRecord, Long?> = createField(DSL.name("timestamp"), SQLDataType.BIGINT, this, "")

    /**
     * The column <code>public.user_scores.replay_length</code>.
     */
    val REPLAY_LENGTH: TableField<UserScoresRecord, Int?> = createField(DSL.name("replay_length"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.replay_data</code>.
     */
    val REPLAY_DATA: TableField<UserScoresRecord, String?> = createField(DSL.name("replay_data"), SQLDataType.CLOB, this, "")

    /**
     * The column <code>public.user_scores.online_score_id</code>.
     */
    val ONLINE_SCORE_ID: TableField<UserScoresRecord, Long?> = createField(DSL.name("online_score_id"), SQLDataType.BIGINT, this, "")

    /**
     * The column <code>public.user_scores.additional_mod_info</code>.
     */
    val ADDITIONAL_MOD_INFO: TableField<UserScoresRecord, Double?> = createField(DSL.name("additional_mod_info"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.ur</code>.
     */
    val UR: TableField<UserScoresRecord, Double?> = createField(DSL.name("ur"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.frametime</code>.
     */
    val FRAMETIME: TableField<UserScoresRecord, Double?> = createField(DSL.name("frametime"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.edge_hits</code>.
     */
    val EDGE_HITS: TableField<UserScoresRecord, Int?> = createField(DSL.name("edge_hits"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.snaps</code>.
     */
    val SNAPS: TableField<UserScoresRecord, Int?> = createField(DSL.name("snaps"), SQLDataType.INTEGER, this, "")

    /**
     * The column <code>public.user_scores.adjusted_ur</code>.
     */
    val ADJUSTED_UR: TableField<UserScoresRecord, Double?> = createField(DSL.name("adjusted_ur"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.mean_error</code>.
     */
    val MEAN_ERROR: TableField<UserScoresRecord, Double?> = createField(DSL.name("mean_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.error_variance</code>.
     */
    val ERROR_VARIANCE: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_variance"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.error_standard_deviation</code>.
     */
    val ERROR_STANDARD_DEVIATION: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.minimum_error</code>.
     */
    val MINIMUM_ERROR: TableField<UserScoresRecord, Double?> = createField(DSL.name("minimum_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.maximum_error</code>.
     */
    val MAXIMUM_ERROR: TableField<UserScoresRecord, Double?> = createField(DSL.name("maximum_error"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.error_range</code>.
     */
    val ERROR_RANGE: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_range"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.user_scores.error_coefficient_of_variation</code>.
     */
    val ERROR_COEFFICIENT_OF_VARIATION: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_coefficient_of_variation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.error_kurtosis</code>.
     */
    val ERROR_KURTOSIS: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_kurtosis"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.error_skewness</code>.
     */
    val ERROR_SKEWNESS: TableField<UserScoresRecord, Double?> = createField(DSL.name("error_skewness"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.keypresses_times</code>.
     */
    val KEYPRESSES_TIMES: TableField<UserScoresRecord, Array<Double?>?> = createField(DSL.name("keypresses_times"), SQLDataType.FLOAT.array(), this, "")

    /**
     * The column <code>public.user_scores.keypresses_median</code>.
     */
    val KEYPRESSES_MEDIAN: TableField<UserScoresRecord, Double?> = createField(DSL.name("keypresses_median"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.keypresses_standard_deviation</code>.
     */
    val KEYPRESSES_STANDARD_DEVIATION: TableField<UserScoresRecord, Double?> = createField(DSL.name("keypresses_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.sliderend_release_times</code>.
     */
    val SLIDEREND_RELEASE_TIMES: TableField<UserScoresRecord, Array<Double?>?> = createField(DSL.name("sliderend_release_times"), SQLDataType.FLOAT.array(), this, "")

    /**
     * The column <code>public.user_scores.sliderend_release_median</code>.
     */
    val SLIDEREND_RELEASE_MEDIAN: TableField<UserScoresRecord, Double?> = createField(DSL.name("sliderend_release_median"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.user_scores.sliderend_release_standard_deviation</code>.
     */
    val SLIDEREND_RELEASE_STANDARD_DEVIATION: TableField<UserScoresRecord, Double?> = createField(DSL.name("sliderend_release_standard_deviation"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.keypresses_median_adjusted</code>.
     */
    val KEYPRESSES_MEDIAN_ADJUSTED: TableField<UserScoresRecord, Double?> = createField(DSL.name("keypresses_median_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.user_scores.keypresses_standard_deviation_adjusted</code>.
     */
    val KEYPRESSES_STANDARD_DEVIATION_ADJUSTED: TableField<UserScoresRecord, Double?> = createField(DSL.name("keypresses_standard_deviation_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.user_scores.sliderend_release_median_adjusted</code>.
     */
    val SLIDEREND_RELEASE_MEDIAN_ADJUSTED: TableField<UserScoresRecord, Double?> = createField(DSL.name("sliderend_release_median_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column
     * <code>public.user_scores.sliderend_release_standard_deviation_adjusted</code>.
     */
    val SLIDEREND_RELEASE_STANDARD_DEVIATION_ADJUSTED: TableField<UserScoresRecord, Double?> = createField(DSL.name("sliderend_release_standard_deviation_adjusted"), SQLDataType.DOUBLE, this, "")

    /**
     * The column <code>public.user_scores.judgements</code>.
     */
    val JUDGEMENTS: TableField<UserScoresRecord, ByteArray?> = createField(DSL.name("judgements"), SQLDataType.BLOB, this, "")

    private constructor(alias: Name, aliased: Table<UserScoresRecord>?): this(alias, null, null, aliased, null)
    private constructor(alias: Name, aliased: Table<UserScoresRecord>?, parameters: Array<Field<*>?>?): this(alias, null, null, aliased, parameters)

    /**
     * Create an aliased <code>public.user_scores</code> table reference
     */
    constructor(alias: String): this(DSL.name(alias))

    /**
     * Create an aliased <code>public.user_scores</code> table reference
     */
    constructor(alias: Name): this(alias, null)

    /**
     * Create a <code>public.user_scores</code> table reference
     */
    constructor(): this(DSL.name("user_scores"), null)

    constructor(child: Table<out Record>, key: ForeignKey<out Record, UserScoresRecord>): this(Internal.createPathAlias(child, key), child, key, USER_SCORES, null)
    override fun getSchema(): Schema? = if (aliased()) null else Public.PUBLIC
    override fun getChecks(): List<Check<UserScoresRecord>> = listOf(
        Internal.createCheck(this, DSL.name("life_bar_graph_check"), "((octet_length(life_bar_graph) <= 524288))", true),
        Internal.createCheck(this, DSL.name("replay_data_check"), "((octet_length(replay_data) <= 524288))", true)
    )
    override fun `as`(alias: String): UserScores = UserScores(DSL.name(alias), this)
    override fun `as`(alias: Name): UserScores = UserScores(alias, this)
    override fun `as`(alias: Table<*>): UserScores = UserScores(alias.getQualifiedName(), this)

    /**
     * Rename this table
     */
    override fun rename(name: String): UserScores = UserScores(DSL.name(name), null)

    /**
     * Rename this table
     */
    override fun rename(name: Name): UserScores = UserScores(name, null)

    /**
     * Rename this table
     */
    override fun rename(name: Table<*>): UserScores = UserScores(name.getQualifiedName(), null)
}
