stemOfconstno test imports itconst stemOf: (module: Module) => stringThe words of a model's name (arcaParty) joined by hyphens: the stem of its file.
The typed tables of a model (commons data 0053-sql-typed): each model (a module of governance) gets a file <model>.auto.ts of the tables that it owns, made from the logical schema and governance and never written by hand: for each table a row type, an insert type (what the database fills may be left out), a key type, and a defineTable value whose columns are typed from the model (a closed list of codes is a union of its names). It reads nothing but the schema, the modules and the naming; the tool tools/typed.ts writes the files and checks that they are up to date.
stemOfconstno test imports itconst stemOf: (module: Module) => stringThe words of a model's name (arcaParty) joined by hyphens: the stem of its file.
ownerOffunctionno test imports itfunction ownerOf(table: Table, domain: string, modules: readonly Module[]): Module | undefinedThe module that owns a table: the one that has the concept or the code list it was made from.
TypedOptionsinterfaceno test imports itinterface TypedOptionsWhat the generator is told.
| Member | Type | What it is |
|---|---|---|
modules | readonly Module[] | The modules of the composition, in the order they were composed; a table belongs to the one whose concept or code list it came from. |
naming? | Naming |
TypedGenerateErrortypeno test imports ittype TypedGenerateError = { readonly kind: "orphan"; readonly table: string } | { readonly kind: "collision"; readonly module: string; readonly name: string };What is wrong with a generation.
typedFilesfunctionno test imports itfunction typedFiles(schema: LogicalSchema, options: TypedOptions): Result<readonly Artifact[], readonly TypedGenerateError[]>The files of the typed tables: one for each module that owns a table, and mod.ts, which names them.
| Parameter | What it is |
|---|---|
schema | the logical schema of the whole composition |
options | the modules and the naming |
Returns: the files, or the tables no module owns and the names that are the same