Skip to content

Commit

Permalink
feat: update Exposed to 0.50.0 and adjust the snowflake column to match
Browse files Browse the repository at this point in the history
  • Loading branch information
GiantTreeLP committed May 3, 2024
1 parent a05a676 commit f5b6d28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ dependencies {
val slf4jVersion = "2.0.13"
val ktorVersion = "2.3.10"

val exposedVersion = "0.49.0"
val exposedVersion = "0.50.0"
val hikariVersion = "5.1.0"
val sqliteVersion = "3.45.3.0"
val mariadbVersion = "3.3.3"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ open class SnowflakeEntityClass<out E : SnowflakeEntity>(table: SnowflakeIdTable

fun Table.snowflake(name: String): Column<Snowflake> = registerColumn(name, SnowflakeColumnType())

class SnowflakeColumnType : ColumnType() {
class SnowflakeColumnType : ColumnType<Snowflake>() {
override fun sqlType(): String = currentDialect.dataTypeProvider.longType()

override fun valueFromDB(value: Any): Snowflake {
Expand All @@ -35,8 +35,7 @@ class SnowflakeColumnType : ColumnType() {
}
}

override fun notNullValueToDB(value: Any): Any {
val v = if (value is Snowflake) value.value.toLong() else value
return super.notNullValueToDB(v)
override fun notNullValueToDB(value: Snowflake): Any {
return value.value.toLong()
}
}

0 comments on commit f5b6d28

Please sign in to comment.