SeedDefinition
Concept: From Metadata to Database →
The parsed contents of a *_seed.json5 file: pre-populated records for
one object.
Declares records that the apply engine upserts (or inserts once, for
user access) alongside DDL convergence. Records are matched against
existing rows by the natural key declared in key, so re-applying the
same file is idempotent.
{ access: "vendor", key: "code", data: [ { code: "USD", name: "US Dollar", symbol: "$", decimalPlaces: 2 }, { code: "EUR", name: "Euro", symbol: "€", decimalPlaces: 2 }, ],}Properties
Section titled “Properties”| Property | Type | Required/Default | Constraints | Meaning |
|---|---|---|---|---|
access |
enum (SeedAccess) |
Required | Who controls this seed data and how mutable it is at runtime. | |
key |
string | Required | The natural key field(s) used to match seed records against existing rows. | |
data |
array of any | Optional | The seed records, inline. | |
file |
string | Optional | Path to an external JSON5 file holding the seed records, for datasets too large to inline comfortably. | |
delete |
array of any | Optional | Natural key values identifying records to remove on the next apply. |
The seed records, inline.
Each entry is a JSON object whose keys match the object’s field
keys. System fields (id, createdAt, updatedAt, objectType,
ownerId) are populated automatically and must not appear here.
Mutually exclusive with file — a *_seed.json5 file sets exactly
one of the two.
Path to an external JSON5 file holding the seed records, for datasets too large to inline comfortably.
Relative to the directory containing the *_seed.json5 file. The
target file’s top-level value must be a bare JSON5 array of record
objects, shaped exactly like data entries. Mutually exclusive
with data — setting both is a loader error. The target file’s
name must not end in a reserved metadata suffix (_module,
_object, _field, _relationship, _seed) followed by
.json5, or the loader would try to parse it as a metadata
definition instead of a plain data file.
delete
Section titled “delete”Natural key values identifying records to remove on the next apply.
Each entry uses the same shape as a key value, identifying an
existing record for deletion rather than upsert.
SeedAccess
Section titled “SeedAccess”Who controls this seed data, and how mutable it is at runtime.
| Value | Applied | Runtime mutability |
|---|---|---|
vendor |
Every apply | Immutable — API writes rejected |
module |
Every apply | Immutable — API writes rejected |
architect |
Every apply | Immutable — API writes rejected |
user |
Once, on first apply | Fully mutable |
| Value | Status | Description |
|---|---|---|
vendor |
Platform vendor. | |
module |
Module developer. | |
architect |
Deploying architect. | |
user |
Initial state only. |
Example
Section titled “Example”{ "access": "vendor", "key": "example"}