Ecto.ERD.Field (Ecto ERD v0.6.3)
View SourceField struct
Represents data of an individual field in Ecto.ERD.Node
.
Feel free to update fields of this struct in .ecto_erd.exs
if needed.
Summary
Types
@type comment() :: String.t()
A field comment.
Rendering of comments is supported only by Mermaid format at the moment.
Example
# File: .ecto_erd.exs
[
map_node: fn
%Ecto.ERD.Node{schema_module: schema_module} = node ->
update_in(node, [Access.key(:fields), Access.all()], fn field ->
# `DocumentationLib` is a fictional module returning documentation about a field
case DocumentationLib.doc({schema_module, field}) do
nil ->
field
doc ->
%{field | comment: doc}
end
end)
end
]