~/bend-docscommunity

ordinary_schema.bend checks

raw source on the hub · import bendvy-ecs-core@0.1.0.3/ordinary_schema.bend as Ordinary_schema

7 imports
import Base
import ./decode_data.bend as D
import ./persistence_declaration.bend as Persist
import ./owner_product.bend as Product
import ./ordinary_declaration.bend as Component
import ./column.bend as Col
import ./schema_fragments.bend as Fragment

Types

type Schema source · line 13 · raw

@-S:Data -> @-Store:Type -> @-Resources:Type -> Data

One normal declaration drives schema entries and physical Store/Resources types. Names default to the one ordinary key. No user metadata or lens input. Detached schema description indexed by the component and resource owner types. It contains no world or payloads; product derives matching owner products. Raw Schema construction is trusted metadata setup.

type Resource source · line 17 · raw

@-S:Data -> @-P:Type -> Data

Schema-scoped resource key and payload type, without a resource instance. Convert with resource_schema before composition and collision validation.

Templates

template resource source · line 21 · raw

@-S:Data -> @-P:Type -> @key:String -> Resource<S, P>

Declare a resource key for schema S and payload P. No payload is allocated or provisioned and duplicate keys are not checked until schema validation.

template resource_key source · line 24 · raw

@-S:Data -> @-P:Type -> @value:Resource<S, P> -> String

Return the authored resource key; does not read a runtime resource.

template component source · line 30 · raw

@-S:Data -> @-P:Type -> @declaration:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> Schema<S, 0x704c77730661eff4309838fc738ef615/column.Column<S, P>, Unit>

Describe a component declaration and derive its column owner type. Does not allocate storage or validate collisions. Compose with product and validate before App attachment; examples/scheduled-health/registration.bend.

template resource_schema source · line 35 · raw

@-S:Data -> @-P:Type -> @declaration:Resource<S, P> -> Schema<S, Unit, P>

Describe a resource and derive its resource owner type without constructing its payload. This declaration supplies metadata, not a live resource value.

template entries source · line 39 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @value:Schema<S, C, R> -> List<&2, 0x704c77730661eff4309838fc738ef615/schema_fragments.Entry<S>>

Return schema entries in composition order, detached from all world owners.

template product source · line 45 · raw

@-S:Data -> @-LC:Type -> @-LR:Type -> @-RC:Type -> @-RR:Type -> @left:Schema<S, LC, LR> -> @right:Schema<S, RC, RR> -> Schema<S, 0x704c77730661eff4309838fc738ef615/owner_product.Owner<LC, RC>, 0x704c77730661eff4309838fc738ef615/owner_product.Owner<LR, RR>>

Compose two same-schema declarations, appending entries left then right and deriving matching component/resource Product.Owner types. Supports arbitrary affine payload types; does not copy payloads or reject collisions.

template validate source · line 50 · raw

@-S:Data -> @-C:Type -> @-R:Type -> @value:Schema<S, C, R> -> 0x704c77730661eff4309838fc738ef615/schema_fragments.Validation

Check composed declaration entries for schema conflicts, returning the structured Fragment.Validation result. No World exists in this operation; validation neither constructs payloads nor proves trusted storage lens laws.

template component_plain source · line 57 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Plain<S, P, identity> -> Schema<S, 0x704c77730661eff4309838fc738ef615/column.Column<S, P>, Unit>

Declare a component with plain persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.

template component_transient source · line 65 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Transient<S, P, identity> -> Schema<S, 0x704c77730661eff4309838fc738ef615/column.Column<S, P>, Unit>

Declare a component with transient persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.

template component_constructed source · line 73 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @-project:(@_:P -> Pair(P, 0x704c77730661eff4309838fc738ef615/decode_data.Raw)) -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Constructed<S, P, identity, project> -> Schema<S, 0x704c77730661eff4309838fc738ef615/column.Column<S, P>, Unit>

Declare a component with constructed persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.

template resource_plain source · line 81 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Plain<S, P, identity> -> Schema<S, Unit, P>

Declare a resource with plain persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.

template resource_transient source · line 89 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Transient<S, P, identity> -> Schema<S, Unit, P>

Declare a resource with transient persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.

template resource_constructed source · line 97 · raw

@-S:Data -> @-P:Type -> @-identity:0x704c77730661eff4309838fc738ef615/ordinary_declaration.Declaration<S, P> -> @-project:(@_:P -> Pair(P, 0x704c77730661eff4309838fc738ef615/decode_data.Raw)) -> @extension:0x704c77730661eff4309838fc738ef615/persistence_declaration.Constructed<S, P, identity, project> -> Schema<S, Unit, P>

Declare a resource with constructed persistence classification from its bound extension. Records the classification and derives the owner type; does not execute codecs, validate input, allocate payloads or export a snapshot. Use the matching persistence declaration and identity when composing a schema.