Skip to content

Commit

Permalink
Merge branch 'main' into hfhbd-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
hfhbd authored May 13, 2024
2 parents 60fb86b + 939ca7f commit 12034f0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin = "2.0.0-RC3"
serialization = "1.6.3"
exposed = "0.49.0"
exposed = "0.50.1"

[libraries]
serialization-core = { module = "org.jetbrains.kotlinx:kotlinx-serialization-core", version.ref = "serialization" }
Expand Down
6 changes: 4 additions & 2 deletions kotlinx-uuid-exposed/api/kotlinx-uuid-exposed.api
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ public class kotlinx/uuid/exposed/KotlinxUUIDTable : org/jetbrains/exposed/dao/i

public final class kotlinx/uuid/exposed/UUIDColumnType : org/jetbrains/exposed/sql/ColumnType {
public fun <init> ()V
public fun nonNullValueToString (Ljava/lang/Object;)Ljava/lang/String;
public fun notNullValueToDB (Ljava/lang/Object;)Ljava/lang/Object;
public synthetic fun nonNullValueToString (Ljava/lang/Object;)Ljava/lang/String;
public fun nonNullValueToString (Lkotlinx/uuid/UUID;)Ljava/lang/String;
public synthetic fun notNullValueToDB (Ljava/lang/Object;)Ljava/lang/Object;
public fun notNullValueToDB (Lkotlinx/uuid/UUID;)Ljava/lang/Object;
public fun sqlType ()Ljava/lang/String;
public synthetic fun valueFromDB (Ljava/lang/Object;)Ljava/lang/Object;
public fun valueFromDB (Ljava/lang/Object;)Lkotlinx/uuid/UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import java.nio.*
* A [UUID] column type for registering in exposed tables.
* @see kotlinxUUID to see how it is used
*/
public class UUIDColumnType : ColumnType() {
public class UUIDColumnType : ColumnType<UUID>() {
override fun sqlType(): String = currentDialect.dataTypeProvider.uuidType()

override fun valueFromDB(value: Any): UUID = when {
Expand All @@ -25,9 +25,9 @@ public class UUIDColumnType : ColumnType() {
else -> error("Unexpected value of type UUID: $value of ${value::class.qualifiedName}")
}

override fun notNullValueToDB(value: Any): Any = currentDialect.dataTypeProvider.uuidToDB(valueToUUID(value))
override fun notNullValueToDB(value: UUID): Any = currentDialect.dataTypeProvider.uuidToDB(valueToUUID(value))

override fun nonNullValueToString(value: Any): String = "'${valueToUUID(value)}'"
override fun nonNullValueToString(value: UUID): String = "'${valueToUUID(value)}'"

internal fun valueToUUID(value: Any): java.util.UUID = when (value) {
is java.util.UUID -> value
Expand Down

0 comments on commit 12034f0

Please sign in to comment.