Expand description
Schema 管理(对应 JS src/schema.js)
与 JS 版的差异:注册表由模块级全局 _schemas 改为显式 Registry 实例。
文件组织:数据结构与字段规范化在 [definition],注册/定位/配置在 [registry]。
对外 API(Registry / Schema / FieldDef / RelationDef / ComputeDef / map_of)
由本模块统一再导出,拆分不改语义。
Structs§
- Compute
Def - Field
Def - Load
Config - 装载配置(
store.config.json的sources+defs) - Location
- 落点:定义之外,由「目录语义 + 连接配置」解析得到(设计 §5.2)。
落点维度 =
source+database+schema(schema仅 PostgreSQL)。 - Registry
- Relation
Def - Schema
- Source
Decl - 一个连接声明(
store.config.json的sources一项)
Enums§
- Profile
- 查询档位:判决唯一在 core(照
Registry::require_context既有范式)。
Functions§
- depth_
layered - 语义层级深度:PG=2(L2=schema),Mongo/MySQL/SQLite=1(L2+ 打平)。
kind 非法 ⇒
Err(禁回落默认)。 - locate
- 由「db 目录以下的相对路径」算落点(设计 §5.2 固定语义,D3):
- map_of
- 便捷构造:
Mapfrom[(&str, Value)] - plan_
load - 纯批次规划(设计 §5.2 伪码 + §5.3 主从):
files: [(rel_from_defs_root, defn)](rel首段 = db 目录名)。