[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:95](https://github.com/evoluhq/evolu/blob/49ea8ca499566aba270f8cb601e7f49aa62320f8/packages/common/src/local-first/Schema.ts#L95)

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.

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

### Example

```ts

import {
  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),
  },
};
expectOk(Schema.todo.title.fromUnknown("Write docs"), "Write docs");

// Zod, or another Standard Schema library
const ZodSchema = {
  todo: {
    id: TodoId,
    title: z.string().min(1).max(100),
    isCompleted: z.union([z.literal(0), z.literal(1)]).nullable(),
  },
};
expect(ZodSchema.todo.title.safeParse("Write docs").success).toBe(true);
```