Skip to content

evolu@8.1.0

Choose a tag to compare

@github-actions github-actions released this 16 Sep 14:49
· 2431 commits to main since this release
a4a6133

Minor Changes

  • 513984c: Evolu JSON

    SQLite supports JSONs by storing them as JSON strings. Evolu already parses JSON strings for Kysely Relations, so we leveraged that feature to support JSON in Evolu without manual parsing and stringifying. 🚀

    Just define some JsonObject or JsonArray on Evolu Schema, and that's all.

    const SomeJson = Schema.struct({
      foo: Schema.string,
      // We can use any JSON type in SQLite JSON.
      bar: Schema.boolean,
    });
    type SomeJson = Schema.Schema.To<typeof SomeJson>;
    
    const TodoCategoryTable = Schema.struct({
      id: TodoCategoryId,
      name: NonEmptyString50,
      json: SomeJson,
    });
    
    create("todoCategory", {
      name,
      json: { foo: "a", bar: false },
    });

    Happy codding.