SR004

Severity: error

Summary: schema has no primary key field

What this means

The schema has one or more fields, but none of them has primary: true. Shaperail requires exactly one primary key per resource to generate correct SQL, route handlers, and CRUD operations.

Example that triggers this

resource: users
version: 1
schema:
  name: { type: string, required: true }

How to fix it

Add primary: true to one field (typically id):

id: { type: uuid, primary: true, generated: true }

Back to top

Shaperail documentation lives in the same repository as the framework so every release has versioned instructions. See the latest release for the most recent version.

This site uses Just the Docs, a documentation theme for Jekyll.