Link to this function
Sleeky.Entity (sleeky v0.0.3)
A entity describes your data.
Similar to an ecto schema, an entity describes its attributes and relations to other entities:
defmodule MyApp.Schema.Blog do
use Sleeky.Entity
attribute :name, :string
has_many :posts
end
defmodule MyApp.Schema.Post do
use Sleeky.Entity
attribute :title, :string
belongs_to :blog
end
Then we combine multiple entities in order to form a schema. Please refer to the Sleeky.Schema
module documentation.
Summary
Functions
Link to this function
action(name, entity)
Link to this function
add_to(item, key, entity)
Link to this function
entity(entity)
Link to this function
field(name, entity)
Link to this function
field!(name, entity)
Link to this function
fields!(names, entity)
Link to this function
new(module)
Link to this function