-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Raph
committed
Aug 26, 2024
1 parent
b10e8a9
commit 3144104
Showing
13 changed files
with
210 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
lorraine/src/commonMain/kotlin/io/dot/lorraine/db/LorraineConstructor.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package io.dot.lorraine.db | ||
|
||
import androidx.room.RoomDatabaseConstructor | ||
//import androidx.room.RoomDatabaseConstructor | ||
|
||
expect object LorraineConstructor : RoomDatabaseConstructor<LorraineDB> | ||
//expect object LorraineConstructor : RoomDatabaseConstructor<LorraineDB> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
lorraine/src/commonMain/kotlin/io/dot/lorraine/db/entity/DataEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package io.dot.lorraine.db.entity | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
private const val KEY = "key" | ||
private const val VALUE = "value" | ||
|
||
@Serializable | ||
@SerialName("type") | ||
internal sealed interface DataEntity<T> { | ||
val key: String | ||
val value: T | ||
} | ||
|
||
@Serializable | ||
@SerialName("int") | ||
internal data class IntData( | ||
@SerialName(KEY) override val key: String, | ||
@SerialName(VALUE) override val value: Int | ||
) : DataEntity<Int> | ||
|
||
@Serializable | ||
@SerialName("long") | ||
internal data class LongData( | ||
@SerialName(KEY) override val key: String, | ||
@SerialName(VALUE) override val value: Long | ||
) : DataEntity<Long> | ||
|
||
@Serializable | ||
@SerialName("double") | ||
internal data class DoubleData( | ||
@SerialName(KEY) override val key: String, | ||
@SerialName(VALUE) override val value: Double | ||
) : DataEntity<Double> | ||
|
||
@Serializable | ||
@SerialName("float") | ||
internal data class FloatData( | ||
@SerialName(KEY) override val key: String, | ||
@SerialName(VALUE) override val value: Float | ||
) : DataEntity<Float> | ||
|
||
@Serializable | ||
@SerialName("string") | ||
internal data class StringData( | ||
@SerialName(KEY) override val key: String, | ||
@SerialName(VALUE) override val value: String | ||
) : DataEntity<String> | ||
|
||
@Serializable | ||
internal data object UnknownData : DataEntity<Any> { | ||
override val key: String | ||
get() = "" | ||
override val value: Any = Any() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.