Developers: Backend
Entity schemas
The JSON format for declaring tables, fields, types and defaults.
The JSON format for declaring tables, fields, types and defaults.
{
"name": "Task",
"type": "object",
"properties": {
"title": { "type": "string", "description": "What needs doing" },
"done": { "type": "boolean", "default": false },
"priority": { "type": "string", "enum": ["low", "medium", "high"], "default": "medium" },
"due": { "type": "string", "format": "date" },
"tags": { "type": "array", "items": { "type": "string" } },
"estimate": { "type": "number" }
},
"required": ["title"],
"rls": { "read": true, "create": true, "update": { "created_by": "{{user.email}}" }, "delete": { "created_by": "{{user.email}}" } }
}
name is PascalCase and must match how you call it: ds.entities.Task.type is always "object"; put properties at the top level.string, number, integer, boolean, array, object. Useful string formats: date, date-time, email, uri.default fills missing fields on create; required rejects creates that lack them.rls is optional; see Security rules.//) are allowed — the files are read as JSONC.Store the related record's id: an Order with customer_id, then ds.entities.Customer.get(order.customer_id) or filter({ customer_id }).