Scrypath.Projection (scrypath v0.3.0)

Copy Markdown View Source

Document projection for schemas declared with use Scrypath.

Scrypath.Projection.document/2 projects the declared fields: [...] by default. When a schema exports search_document/1, that hook takes precedence and the document source becomes :custom.

Association-derived data requires explicit preload work before projection. Scrypath does not reach through unloaded associations or infer extra queries on behalf of the caller.

Summary

Functions

document(schema_module, source_record)

@spec document(module(), struct() | map()) :: Scrypath.Document.t()

document_source(schema_module)

@spec document_source(module()) :: :custom | :fields