[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Schema](https://evolu.dev/docs/api-reference/common/local-first/Schema) › EvoluSchema

```ts
type EvoluSchema = ReadonlyRecord<string, TableSchema>;
```

Defined in: [packages/common/src/local-first/Schema.ts:114](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/local-first/Schema.ts#L114)

Defines the schema of an Evolu database.

Column types are Standard Schema v1 compatible — use Evolu Type, Zod,
Valibot, ArkType, or any library that implements Standard Schema.

Each column schema's inferred output must be compatible with SQLite. Numeric
outputs must be assignable to [FiniteNumber](https://evolu.dev/docs/api-reference/common/Type/variables/FiniteNumber). Standard Schema does not
standardize nominal brands, so a library-specific finite validator whose
output remains `number` must brand its validated output compatibly.

Table schema defines columns that are required for table rows. For optional
columns, use a schema whose output type includes `null`.

### Example

```ts

import {
  assertOk,
  assertType,
  assertTrue,
  type FiniteNumber,
  id,
  NonEmptyTrimmedString100,
  nullOr,
  SqliteBoolean,
} from "@evolu/common";

// Evolu Type
const TodoId = id("Todo");
type TodoId = typeof TodoId.Output;

const Schema = {
  todo: {
    id: TodoId,
    title: NonEmptyTrimmedString100,
    isCompleted: nullOr(SqliteBoolean),
  },
};
assertOk(Schema.todo.title.fromUnknown("Write docs"), "Write docs");

// Zod, or another Standard Schema library
// Zod 4 numbers are finite by default; Evolu Type Number models all JavaScript numbers.
const ZodFiniteNumber = z
  .number()
  .transform((value): FiniteNumber => value as FiniteNumber);
assertType<FiniteNumber, z.output<typeof ZodFiniteNumber>>();

const ZodSchema = {
  todo: {
    id: TodoId,
    title: z.string().min(1).max(100),
    position: ZodFiniteNumber,
    isCompleted: z.union([z.literal(0), z.literal(1)]).nullable(),
  },
};
assertTrue(ZodSchema.todo.title.safeParse("Write docs").success);
```