Versioned.Multi (Versioned v0.3.1) View Source
Tools for operating on versioned records.
Link to this section Summary
Functions
To be invoked after Repo.transaction/1
. If successful, the id of "_version"
will be attached to the :version_id
field of "_record".
Returns an Ecto.Multi with all steps necessary to delete a versioned record.
Returns an Ecto.Multi with all steps necessary to insert a versioned record.
Returns an Ecto.Multi with all steps necessary to update a versioned record.
Link to this section Functions
Specs
To be invoked after Repo.transaction/1
. If successful, the id of "_version"
will be attached to the :version_id
field of "_record".
Specs
delete( Ecto.Multi.t(), atom() | String.t(), Ecto.Schema.t() | Ecto.Changeset.t(), Keyword.t() ) :: Ecto.Multi.t()
Returns an Ecto.Multi with all steps necessary to delete a versioned record.
An Ecto.Multi is returned which first updates the record itself, inserts a new version into the versions table and finally deletes associations as needed.
If name
is "puppy"
, the returned parts will be:
"puppy_record"
- The updated record itself."puppy_version"
- The newly inserted version record (is_deleted=TRUE).
Specs
insert( Ecto.Multi.t(), atom() | String.t(), Ecto.Schema.t() | Ecto.Changeset.t(), keyword() ) :: Ecto.Multi.t()
Returns an Ecto.Multi with all steps necessary to insert a versioned record.
If name
is "puppy"
, the returned parts will be:
"puppy_record"
- The inserted record itself."puppy_version"
- The inserted version record.
Specs
update(Ecto.Multi.t(), atom() | String.t(), Ecto.Changeset.t(), keyword()) :: Ecto.Multi.t()
Returns an Ecto.Multi with all steps necessary to update a versioned record.
An Ecto.Multi is returned which first updates the record itself, inserts a new version into the versions table and finally deletes associations as needed.
If name
is "puppy"
, the returned parts will be:
"puppy_record"
- The updated record itself."puppy_version"
- The newly inserted version record."puppy_deletes"
- List of association version records which were deleted.