jonnify·bcs /bcs/elixir-core/property-stores

B2.2 · Property Stores on ETS — manuscript chapter 2.2

The substrate becomes the database.

Three system tables under one tree — AST instruments, PRT balances, ORD orders — with the branded id as the only key, chronology as a property of the keyspace rather than a column, and exactly one amendment to the store module: window/3.

The chapter is content/bcs2.2.md; the rung behind it is bcs2.2 (bcs_rung_2_2_check.exs), its committed transcript closes PASS 5/5 — and the 2.1 rung re-runs green under the grown surface. Every figure on this module's pages is verbatim from those outputs.

The rung, line by line. Select a line to read its verbatim transcript text.
boot three stores P1 shape P2 key P3 order P4 window P5 review
readout · Select a line to read its transcript text, verbatim, with a one-sentence reading. The full transcript is frozen in §2 below.
§1

The desk's three questions

content/bcs2.2.md · Why
LATEST

A newest-first page

What are the latest orders is a page off the table tail — page_desc/2, a prev walk from the table's end, no timestamp column consulted.

BETWEEN

A window

What happened between 14:30 and 14:32 is a half-open window — two synthetic cursors and one gated select, window/3.

KNOWN NAME

A get by name

What is this instrument is get/2 — the branded id is the only key, so the name is the lookup.

A database that needs a timestamp column, an index on it, and a query planner to answer the first two has paid three times for what the keyspace already carries. The part preface's guideline — a table keyed by branded ids is a timeline, add no second clock — is cashed here as working reads on real stores.

§2

The proof

content/bcs2.2.md · quoting bcs_rung_2_2_check.out

Five gates over three real stores: the database's shape, the only-key law, both chronology reads, and the review itself. The committed transcript:

content/echo_data/runtimes/elixir/bcs_rung_2_2_check.out · verbatimfrozen
boot: three system tables under one tree -- AST instruments, PRT balances, ORD orders
P1 shape ok -- instrument and balance rows live behind their own boundaries; values are private representations
P2 key ok -- the branded form is the only key: the same snowflake's decimal rendering refused as :invalid
P3 order ok -- newest five by byte order equal the last five minted: no timestamp column consulted
P4 window ok -- window [tA,tB) by synthetic cursors returned 100 of 100 expected, ascending by key
P5 review ok -- surface grew by exactly one export: window/3 -- the review Chapter 2.1's decision required, performed
PASS 5/5

A gate line is a recording of what the store refused or returned on stage, committed beside the script that produced it. The amendment behind P5 was performed the way Chapter 2.1's decision requires — as an architecture review with the surface gate as its instrument — while the 2.1 rung re-runs green under the grown surface.

§3

The dives

three lessons, fixed by the chapter spec

Reach for get/2 when the name is known, page_desc/2 when the question is latest, window/3 when the question is between — and no fourth read has earned an export yet, which is the review bar working. The moment who holds this asset becomes a question, the pair is a relation, and Chapter 2.5 owns it.

§4

References

sources · related

Sources

Related