Skip to content

schema(definitions): SchemaMetadata

Defined in: schema/schema.ts:29

Compiles a schema definition into a normalized metadata object.

Parameters

definitions

Record<string, Record<string, FieldBuilder>>

Raw model definitions from user code.

Returns

SchemaMetadata

The compiled schema metadata.

Throws

When the definition violates validation rules.

Example

ts
const meta = schema({
  User: {
    id:    field.string().primaryKey(),
    email: field.string().unique(),
    name:  field.string().optional(),
    age:   field.number().optional().default(0),
  },
});

Released under the MIT License.