Osy#betaRun it on Osyrin: osyrin.com

Reference

Entity

18 pages.

The data model (entities and their rules)

An entity is a table — and the rules that are true about it. Not just its columns: what must hold for a row to exist, and who may see or change it…

Atomic updates (-= and +=)

`x.Stock -= n` and `x.Stock += n` on a stored number are written as ONE statement relative to the row as the database holds it, refused when it would…

Changes

The lightweight, ungated answer to "who changed this row, and when": field NAMES only, never values, newest first. Readable by anyone who may read…

Comparing entity rows

`==` on two entity references compares them by ROW IDENTITY — not by object reference, and not field by field. Two references to the same row are…

ConcurrencyCheck

Plain optimistic concurrency: refuses an update whose value was changed by somebody else after the value the write was based on — what the writer…

Extension members

A `partial entity X { … }` in a bridge package or in the app adds OPTIONAL members to an entity another package declares — a reference (a column on…

[CreatedAt] [CreatedBy] [ModifiedAt] [ModifiedBy]

Row stamps: an entity declares a field and marks it, and the platform writes into it when the row is saved — the instant it was created, who created…

[FrontMatter] — a document's header as typed data

`[FrontMatter]` binds a member to a key of the entity's markdown document's front-matter — the `---` header at the top of the file. Assigning the…

[OnDelete]

`[OnDelete]` on an `Entity` member says what deleting the row it references does to the row holding it: Remove deletes it too, Clear empties the…

[Title] on an entity

`[Title]` on an entity says what each of its records is called — the line a notification, a search result or a link shows for it. `Records.Title(x)`…

constraints

The per-member rules the database enforces — Required, Unique, MaxLength/MinLength, Min/Max, Pattern, and the storage-shaping Immutable, Precision…

entity

Declares a persisted type — a table of rows the app stores, queries and secures. Every entity gets an Id from the platform. Use a class instead when…

entity Sub : Base

Derives one entity from another. The subtype is its own type with its own name, its own security and its own workflows, and it carries every member…

entity members

The typed members an entity holds — text, numbers, dates, booleans, Guids, enums and references. A member's type spelling carries its nullability: a…

invariant

A row-level rule spanning several members, checked when the row is written. Use it when a constraint on one member is not enough — a balance that may…

override (a narrower reference)

On a subtype, `override Company Organization;` narrows a reference the base declares to a type derived from the base's: the same member and the same…

relations

One entity points at another by declaring it as a member — that is the foreign key. The parent reads its children back through a collection member…

sealed

Declares that no type may derive from this entity. A type is open unless it says otherwise, exactly as in C#. Sealing says nothing about who may read…