API reference@evolu/common › local‑first/Schema

Database schema definition and validation.

Functions

FunctionDescription
createQueryBuilderCreates a query builder from a EvoluSchema.
ensureSqliteSchema-
evoluSchemaToSqliteSchema-
getEvoluSqliteSchema-

Interfaces

InterfaceDescription
MutationChangeA DbChange is a change to a table row. Together with a unique Timestamp, it forms a CrdtMessage.
MutationOptions-
SqliteSchemaDep-
SystemColumnsSystem columns that are implicitly defined by Evolu.

Type Aliases

Type AliasDescription
AnyStandardSchemaV1Any StandardSchemaV1.
CreateQuery-
EvoluSchemaDefines the schema of an Evolu database.
IndexesConfig-
InsertValuesInsert values: id omitted (auto-generated), nullable columns optional, non-nullable columns required.
MutationMutation function type. Accepts already-validated values — validation is the caller's responsibility using any Standard Schema library (Evolu Type, Zod, Valibot, ArkType, etc.).
MutationKind-
MutationValuesDerives the expected values type for a mutation from a table's column schemas and a MutationKind.
NullableColumnsToOptionalMakes columns whose output type includes null optional.
OptionalColumnKeys-
RequiredColumnKeys-
SchemaValidationErrorSchema validation error that shows clear, readable messages
TableSchemaA table schema: column names mapped to Standard Schema validators.
UpdateValuesUpdate values: id required, all other columns optional. Includes isDeleted for soft deletes.
UpsertValuesUpsert values: id required, nullable columns optional, non-nullable columns required. Includes isDeleted for soft deletes.
ValidateColumnTypes-
ValidateIdColumnType-
ValidateNoSystemColumns-
ValidateSchemaValidates an EvoluSchema at compile time, returning the first error found as a readable string literal type. This approach provides much clearer and more actionable TypeScript errors than the default, which are often hard to read.
ValidateSchemaHasId-

Variables

VariableDescription
kysely-
systemColumns-
SystemColumnsSystem columns that are implicitly defined by Evolu.
systemColumnsWithId-