pub struct TableModel {
pub name: String,
pub audience: Audience,
pub list_path: Option<String>,
pub key_path: Option<String>,
pub schema: Option<Value>,
pub columns: Vec<ColumnModel>,
pub primary_key: Option<ColumnModel>,
pub row_shape_known: bool,
pub has_read: bool,
pub has_create: bool,
pub has_replace: bool,
pub has_delete: bool,
}Expand description
One declared table, as the contract publishes it.
Fields§
§name: StringThe table’s name, from the actions that name it.
audience: AudienceThe audience every action of the table is served to. A surface
says a credential is needed and nothing more — owner and
tenant-members both publish as Subject.
list_path: Option<String>The page’s path as published (/note).
key_path: Option<String>The single-row path as published (/note/{key}); None exactly
when the contract publishes no single-row action, which is a
composite-key table.
schema: Option<Value>The row schema the contract carries on create-{t} (falling back
to replace-{t}’s). None when the contract publishes none — a
read-only table’s entry carries no schema anywhere, which is the
known gap.
columns: Vec<ColumnModel>The row’s columns, read out of TableModel::schema, in the
order the schema lists them — the declaration’s order. Empty
whenever the contract carries no schema, which is a fact about
the contract, not an error.
primary_key: Option<ColumnModel>The column the schema marks as the single primary key — the one
a single-row path substitutes. None when the contract carries
no schema (a read-only table’s known gap), when the schema marks
several columns (a composite key, which cannot travel one path
segment), or when the table has no single-row routes to substitute
it into.
row_shape_known: boolWhether the contract says anything at all about the row’s shape:
true exactly when a schema travelled. A read-only table
publishes list and read and no write, and the write is where
a row schema travels — so its shape is unknown and the generated
client says so rather than guessing.
has_read: bool§has_create: bool§has_replace: bool§has_delete: bool