You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it's very inconvenient to use insert fluent API with Kotlin nullable variables, because you can't use GenericInsertSpec.value(...) method. Nullable values should be allowed and just passed to nullValue(...) method.
You can workaround the problem with simple Kotlin extension function:
fun <T> DatabaseClient.GenericInsertSpec<T>.safeValue(field: String, value: Any?): DatabaseClient.GenericInsertSpec<T> =
if (value == null) {
this.nullValue(field)
} else {
this.value(field, value)
}