Cohere.Derive.Schemas (Cohere v0.1.0)

Copy Markdown View Source

Derives object shape from Ecto schemas via __schema__/1 reflection.

This is the semantic half of the ontology: objects (schemas), properties (fields with real types, enum values included), and links (associations, recorded with name, cardinality, target, and owner key — because assoc name ≠ target module ≠ foreign key in real codebases).

Works on compiled modules only; never parses source. Degrades to an empty list when Ecto is absent.

Summary

Functions

Derives %Schema{} for every schema module in the given list.

Describes one schema module, or nil if it isn't one.

Human-stable label for a field type. Enums render their values — those values are the vocabulary of the domain and belong in the map.

Functions

derive(schema_modules)

Derives %Schema{} for every schema module in the given list.

describe(module)

Describes one schema module, or nil if it isn't one.

type_label(module, field)

Human-stable label for a field type. Enums render their values — those values are the vocabulary of the domain and belong in the map.