Ecto schemas for persisting Beancount directives.
These schemas are the storage-layer counterpart of the Beancount.Directives.*
structs. Beancount.Storage.store/1 converts each directive into the matching
schema and inserts it; Beancount.Storage.load/0 reads the rows back and
rebuilds the original directive structs.
Each dated directive is stored in its own table and carries a file_order
integer that records the directive's zero-based position in the original
source, so the ledger can be reconstructed in its authored order.
Schema to directive map
Beancount.Schemas.Posting and Beancount.Schemas.CostSpec are embedded
schemas nested inside Beancount.Schemas.Transaction; they have no table of
their own.
Example
Beancount.Storage.store([Beancount.open(~D[2026-01-01], "Assets:Bank", ["USD"])])
[%Beancount.Directives.Open{account: "Assets:Bank"}] = Beancount.Storage.load()