Skip to content

Is not serialized by SQLite on complex field #661

@KiddoV

Description

@KiddoV

I ran into two issues when using Brick + SQLite:

Serialization of nested objects with custom generators

@Sqlite(
  columnType: Column.text,
  fromGenerator: "PhoneMeta.fromJson(jsonDecode(%DATA_PROPERTY%))",
  toGenerator: "%INSTANCE_PROPERTY% == null ? null : jsonEncode(%INSTANCE_PROPERTY%?.toJson())"
)
final PhoneMeta? phone;

When select I got an error

WherePhrase([
  Where.exact("creatorId", currUser.localId),
  WherePhrase([
    Or("email").isExactly(email),
    Or("phone").isExactly(phone) // <<<====
  ])
])
Invalid argument(s): Field phone on Person is not serialized by SQLite

Isn't I already define it as text type column. Why is it still throw error?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions