← Back to Stormify Documentation

TypeConversion

Type conversion registry for scalar values (numbers, strings, dates, booleans, etc.).

Provides bidirectional conversion between all scalar types the database layer may encounter: Kotlin primitives, java.math/sql/time types (JVM), ionspin bignum (optional on JVM, always on native), and kotlinx-datetime (optional on JVM, always on native).

Entity-level conversions (e.g. foreign key → entity object) are handled at the ORM layer (Stormify), not here.

Functions

Link copied to clipboard
fun <T : Any> castScalar(targetClass: KClass<T>, value: Any?): T?

Convert a scalar value to the target class.

Link copied to clipboard
fun register(sourceClass: KClass<*>, targetClass: KClass<*>, converter: (Any) -> Any)

Register a custom conversion function.