Package-level declarations

Types

Link copied to clipboard
sealed interface PgInterval

Represents a PostgreSQL interval type, which can be a finite period of time or infinite.

Functions

Link copied to clipboard
fun PgInterval.toDateTimePeriod(): DateTimePeriod

Converts this PgInterval to a Kotlinx DateTimePeriod.

Link copied to clipboard

Converts by flattening everything to microseconds, assuming (like PostgreSQL justify_interval): 1 month = 30 days, 1 day = 24 hours.

Link copied to clipboard

Converts strictly. The interval cannot have days and months set, because they have variable length in the calendar.

Link copied to clipboard
fun DateTimePeriod.toPgInterval(): PgInterval

Converts a Kotlinx DateTimePeriod to a PgInterval.

Link copied to clipboard

Splits absolute time into months (30 days), days (24h) and the rest of the time, according to the PostgreSQL approximation standard.

Link copied to clipboard

Converts this Duration strictly to a PgInterval. The resulting interval will solely have the PgInterval.Finite.time component set, with PgInterval.Finite.days and PgInterval.Finite.months set to zero.