KotlinDurationColumnType

Column for storing time-based amounts of time, as Duration.

Samples

import kotlinx.datetime.*
import kotlinx.datetime.TimeZone
import org.jetbrains.exposed.sql.Column
import org.jetbrains.exposed.sql.ColumnType
import org.jetbrains.exposed.sql.IDateColumnType
import org.jetbrains.exposed.sql.Table
import org.jetbrains.exposed.sql.vendors.*
import java.sql.ResultSet
import java.time.OffsetDateTime
import java.time.ZoneId
import java.time.ZoneOffset.UTC
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeFormatterBuilder
import java.time.temporal.ChronoField
import java.util.*
import kotlin.time.Duration
import kotlin.time.Duration.Companion.nanoseconds

fun main() { 
   //sampleStart 
   registerColumn(name, KotlinDurationColumnType()) 
   //sampleEnd
}

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override var nullable: Boolean

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
Link copied to clipboard
open override fun nonNullValueToString(value: Duration): String
Link copied to clipboard
open override fun notNullValueToDB(value: Duration): Any
Link copied to clipboard
open fun parameterMarker(value: Duration?): String
Link copied to clipboard
open override fun readObject(rs: ResultSet, index: Int): Any?
Link copied to clipboard
open fun setParameter(stmt: PreparedStatementApi, index: Int, value: Any?)
Link copied to clipboard
open override fun sqlType(): String
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun valueFromDB(value: Any): Duration
Link copied to clipboard
open fun valueToDB(value: Duration?): Any?
Link copied to clipboard
open fun valueToString(value: Duration?): String