Package-level declarations

Types

Link copied to clipboard

Writes a BigDecimal into JSON as a bare number, keeping every digit it had.

Link copied to clipboard
open class EnumWithCaseConventionSerializer<E : Enum<E>>(enumName: String, entries: EnumEntries<E>, pgConvention: CaseConvention = CaseConvention.SNAKE_CASE_UPPER, kotlinConvention: CaseConvention = CaseConvention.PASCAL_CASE) : KSerializer<E>

Writes an enum constant into JSON under the label PostgreSQL knows it by, rather than under its Kotlin name.

Link copied to clipboard
object InstantWithInfinitySerializer : KSerializer<Instant>

Writes an Instant the way a timestamptz column holds it, so that (payload->>'issued')::timestamptz reads back what was put in.

Link copied to clipboard
object LocalDateTimeWithInfinitySerializer : KSerializer<LocalDateTime>

Writes a LocalDateTime the way a timestamp column holds it, so that (payload->>'taken')::timestamp reads back what was put in.

Link copied to clipboard
object LocalDateWithInfinitySerializer : KSerializer<LocalDate>

Writes a LocalDate the way a date column holds it, so that (payload->>'until')::date reads back what was put in.

Link copied to clipboard
internal object PgDateText

Translates the year between the way ISO-8601 writes it and the way PostgreSQL does.

Properties

Link copied to clipboard
val octaviusJson: Json

A Json carrying octaviusSerializersModule and otherwise left alone.

Link copied to clipboard
val octaviusSerializersModule: SerializersModule

The contextual serializers for the four types whose JSON form does not match their column form.

Functions

Link copied to clipboard
internal expect fun decodeBigDecimalNative(decoder: Decoder): BigDecimal

The token as it stood in the text, read before anything could narrow it to a Double.

internal actual fun decodeBigDecimalNative(decoder: Decoder): BigDecimal

The token as it stood in the text, read before anything could narrow it to a Double.

internal actual fun decodeBigDecimalNative(decoder: Decoder): BigDecimal

The token as it stood in the text, read before anything could narrow it to a Double.

Link copied to clipboard
internal expect fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

The literal to write, which is where the platforms differ: one holds digits, the other holds a number.

internal actual fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

The JS BigDecimal already holds the text, so there is nothing to format on the way out.

internal actual fun encodeBigDecimalNative(encoder: Encoder, value: BigDecimal)

toPlainString and not toString: the latter switches to scientific notation once the exponent is far enough from the scale, and 1.0E+10 is not a JSON number.