# InstantColumnType

abstract class InstantColumnType<T> : ColumnType<T> , IDateColumnType

Base column type for storing timestamp values representing instants in time.

This abstract class handles timestamp columns that store precise moments in time, typically represented as instants since the Unix epoch. Unlike datetime columns, timestamps are timezone-aware and represent absolute points in time.

#### Type Parameters

T

The application-specific instant type (e.g., Instant, kotlin.time.Instant)

#### See also

IDateColumnType
KotlinInstantColumnType

## Constructors

InstantColumnType
Link copied to clipboard
constructor()

## Properties

hasTimePart
Link copied to clipboard
open override val hasTimePart: Boolean = true
isAutoInc
Link copied to clipboard
val IColumnType<*>.isAutoInc: Boolean

Returns `true` if this is an auto-increment column, `false` otherwise.

nullable
Link copied to clipboard
open override var nullable: Boolean

Returns `true` if the column type is nullable, `false` otherwise.

## Functions

equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
fromInstant
Link copied to clipboard
abstract fun fromInstant(instant: Instant): T
hashCode
Link copied to clipboard
open override fun hashCode(): Int
nonNullValueAsDefaultString
Link copied to clipboard
open override fun nonNullValueAsDefaultString(value: T & Any): String

Returns the String representation of the specified non-null value when value is set as the default for the column.

nonNullValueToString
Link copied to clipboard
open override fun nonNullValueToString(value: T & Any): String

Returns the SQL representation of the specified non-null value, for this column type.

notNullValueToDB
Link copied to clipboard
open override fun notNullValueToDB(value: T & Any): Any

Returns an object compatible with the database, from the specified non-null value, for this column type.

parameterMarker
Link copied to clipboard
open fun parameterMarker(value: T?): String

Defines the appearance of parameter markers in prepared SQL statements.

readObject
Link copied to clipboard
open override fun readObject(rs: RowApi, index: Int): Any?

Returns the object at the specified index in the rs.

setParameter
Link copied to clipboard
open fun setParameter(stmt: PreparedStatementApi, index: Int, value: Any?)

Sets the value at the specified index into the stmt.

sqlType
Link copied to clipboard
open override fun sqlType(): String

Returns the SQL type of this column.

toInstant
Link copied to clipboard
abstract fun toInstant(value: T): Instant
toString
Link copied to clipboard
open override fun toString(): String
validateValueBeforeUpdate
Link copied to clipboard
open fun validateValueBeforeUpdate(value: T?)

Function checks that provided value is suites the column type and throws IllegalArgumentException otherwise. value can be of any type (including Expression)

valueAsDefaultString
Link copied to clipboard
open fun valueAsDefaultString(value: T?): String

Returns the String representation of the specified value when value is set as the default for the column. If the value is `null` and the column is not nullable, an exception will be thrown. Used for metadata default value comparison.

valueFromDB
Link copied to clipboard
open override fun valueFromDB(value: Any): T

Converts the specified value (from the database) to an object of the appropriated type, for this column type. Default implementation returns the same instance.

valueToDB
Link copied to clipboard
open fun valueToDB(value: T?): Any?

Returns an object compatible with the database, from the specified value, for this column type.

valueToString
Link copied to clipboard
open fun valueToString(value: T?): String

Returns the SQL representation of the specified value, for this column type. If the value is `null` and the column is not nullable, an exception will be thrown. Used when generating an SQL statement and when logging that statement.