override fun setValue()

in exposed-r2dbc/src/main/kotlin/org/jetbrains/exposed/v1/r2dbc/mappers/DateTimeNullTypeMapper.kt [25:51]


    override fun setValue(
        statement: Statement,
        dialect: DatabaseDialect,
        typeMapping: R2dbcTypeMapping,
        columnType: IColumnType<*>,
        value: Any?,
        index: Int
    ): Boolean {
        if (columnType !is IDateColumnType) return false
        if (value != null) return false

        val temporalSupported = dialect is OracleDialect || (dialect is MysqlDialect && dialect !is MariaDBDialect)

        if (temporalSupported) {
            statement.bindNull(index - 1, java.time.temporal.Temporal::class.java)
            return true
        } else {
            for (option in classOptions) {
                try {
                    statement.bindNull(index - 1, option)
                    return true
                } catch (_: RuntimeException) {
                }
            }
            return false
        }
    }