Model
Id
Branded Id Schema for any table Id.
To create Id Schema for a specific table, use id
.
id
A factory function to create Id
Schema for a specific table.
Example
import * as S from "@effect/schema/Schema";
import * as Evolu from "@evolu/react";
const TodoId = Evolu.id("Todo");
type TodoId = S.Schema.To<typeof TodoId>;
S.parse(TodoId)(value));
Mnemonic
Mnemonic is a password generated by Evolu in BIP39 format.
A mnemonic, also known as a "seed phrase," is a set of 12 words in a specific order chosen from a predefined list. The purpose of the BIP39 mnemonic is to provide a human-readable way of storing a private key.
OwnerId
The unique identifier of Owner
safely derived from its Mnemonic
.
Owner
Owner
represents the Evolu database owner. Evolu auto-generates Owner
on
the first run. Owner
can be reset on the current device and restored
on a different one.
SqliteBoolean
SQLite doesn't support the boolean type, so Evolu uses SqliteBoolean
instead.
Use the cast
helper to cast SqliteBoolean
from boolean and back.
sqlite.org/quirks.html#no_separate_boolean_datatype (opens in a new tab)
SqliteDate
SQLite doesn't support the Date type, so Evolu uses SqliteDate
instead.
Use the cast
helper to cast SqliteDate
from Date and back.
https://www.sqlite.org/quirks.html#no_separate_datetime_datatype (opens in a new tab)
cast
A helper for casting types not supported by SQLite.
SQLite doesn't support Date nor Boolean types, so Evolu emulates them
with SqliteBoolean
and SqliteDate
.
Example
// isDeleted is SqliteBoolean
.where("isDeleted", "is not", cast(true))
String1000
A string with a maximum length of 1000 characters.
Example
import * as S from "@effect/schema/Schema";
import * as Evolu from "@evolu/react";
Schema.parse(Evolu.String1000)(value));
NonEmptyString1000
A nonempty string with a maximum length of 1000 characters.
Example
import * as S from "@effect/schema/Schema";
import * as Evolu from "@evolu/react";
Schema.parse(Evolu.NonEmptyString1000)(value));