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
Because KotlinX Serialization handles marshalling/unmarshalling enums, if you don't provide a @SerialName, the default serializer will use enum.ordinal.
This is difficult: you can't query against the ordinal Int, since your entity presumably defines it as the Enum, so your Where will look like:
MyEntity::direction eq 2//💥 type error
if you try to do MyEntity::direction eq Direction.North.name, it'll compile but Sqkon won't return any data...unless you use SerialName("North") as a workaround
The text was updated successfully, but these errors were encountered:
I think value binding needs to be serialization-aware, e.g. bindValue should be running the value through KeyValueStorage.serializer and binding a string instead of the raw value. So Eq<MyEntity, Direction> should also carry typeof<Direction>(), and KeyValueStorage should use the serialized value when preparing the SQL statement.
Because KotlinX Serialization handles marshalling/unmarshalling enums, if you don't provide a
@SerialName
, the default serializer will useenum.ordinal
.This is difficult: you can't query against the ordinal Int, since your entity presumably defines it as the Enum, so your Where will look like:
if you try to do
MyEntity::direction eq Direction.North.name
, it'll compile but Sqkon won't return any data...unless you useSerialName("North")
as a workaroundThe text was updated successfully, but these errors were encountered: