Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses source with the pinned leyline binary and writes the result to output — the library equivalent of `mache build <source> <output>` with no --schema flag. That is the common case, and it is what Open expects: a raw leyline-parsed .db (nodes/node_defs/node_refs), which SQLiteGraph reads directly with no import/populate step (see Open's doc comment).
The leyline binary is resolved the same way every mache entry point resolves it (PATH, if it matches the pin; else the version-namespaced cache; else auto-download, SHA-verified) — see leyline.ResolveBinary. Set MACHE_NO_LEYLINE to opt out of auto-download; Build then fails with a clear error instead of silently falling back to anything else, since leyline is mache's only parser.
This does NOT run mache's --schema re-projection path (Engine + ASTWalker over a custom api.Topology) — that stays CLI-only for now. It also does not stamp the CLI's _mache_meta provenance table: mache_version/ mache_commit there identify the mache BINARY that built the file, which a library caller isn't one of, and nothing in this package or Open reads that table.
func ParseWithSchema ¶
ParseWithSchema parses source with the pinned leyline binary and projects the resulting AST through topology into output. It is the library equivalent of `mache build --schema` for callers that already hold a topology.
output is published atomically: a reader sees the previous database or the finished one, never a partial or missing file, and a failed build leaves the previous database in place.
func ParseWithSchemaRef ¶
ParseWithSchemaRef resolves a bundled preset name or schema file relative to baseDir, then parses and projects source into output.
Types ¶
type Option ¶
type Option func(*parseOptions)
Option configures ParseWithSchema and ParseWithSchemaRef.
func WithFinalize ¶
WithFinalize runs fn against the finished database before it is published at output. fn receives the database's private path, not output: anything it writes lands in the same atomic publish as the projection. Writing to output after the build returns would modify a file readers may already have open.
An error from fn abandons the build and leaves output as it was.