Packages
integratedb
0.1.0
IntegrateDB is a database sharing system. It provides integration primitives and data ownership and migration controls. Use it to integrate applications directly through a Postgres database.
Current section
Files
Jump to
Current section
Files
lib/integrate/specification/match_alternative.ex
defmodule Integrate.Specification.MatchAlternative do
use Integrate, :schema
@derive {Jason.Encoder, only: [:path, :fields]}
embedded_schema do
embeds_one :path, Specification.Path
embeds_many :fields, Specification.Field
end
@doc false
def changeset(schema, attrs) do
schema
|> cast(attrs, [])
|> cast_embed(:path, required: true)
|> cast_embed(:fields)
end
end