Integrate.Claims (IntegrateDB v0.1.0) View Source

The Claims context.

Link to this section Summary

Functions

Returns an %Ecto.Changeset{} for tracking claim changes.

Returns an %Ecto.Changeset{} for tracking claim changes.

Returns an %Ecto.Changeset{} for tracking column changes.

Returns an %Ecto.Changeset{} for tracking column_alternative changes.

Creates a claim alternative.

Creates a column_alternative.

Deletes a claim.

Deletes a claim alternative.

Deletes a column.

Deletes a column_alternative.

Gets the associated claims for a spec, preloaded with their child associations.

Gets a single claim.

Gets a single claim alternative.

Gets a single column.

Gets a single column_alternative.

Initialises a claim_alternative and its child columns at the same time.

Initialises a claim with its alternatives.

Initialise a column_alternative.

Returns the list of claim alternatives.

Returns the list of claims.

Returns the list of column_alternatives.

Returns the list of columns.

Coerce a list of claims to a {schema, table}: column_names map.

Updates a claim.

Updates a column.

Link to this section Functions

Link to this function

change_claim(claim, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking claim changes.

Examples

iex> change_claim(claim)
%Ecto.Changeset{data: %Claim{}}
Link to this function

change_claim_alternative(claim_alternative, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking claim changes.

Examples

iex> change_claim(claim)
%Ecto.Changeset{data: %ClaimAlternative{}}
Link to this function

change_column(column, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking column changes.

Examples

iex> change_column(column)
%Ecto.Changeset{data: %Column{}}
Link to this function

change_column_alternative(column_alternative, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking column_alternative changes.

Examples

iex> change_column_alternative(column_alternative)
%Ecto.Changeset{data: %ColumnAlternative{}}
Link to this function

column_grants_for(name, privilege \\ "SELECT")

View Source
Link to this function

create_claim(spec, attrs \\ %{})

View Source

Creates a claim.

Examples

iex> create_claim(%Spec{} = spec, %{field: value})
{:ok, %Claim{}}

iex> create_claim(%Spec{} = spec, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_claim_alternative(claim, attrs \\ %{})

View Source

Creates a claim alternative.

Examples

iex> create_claim_alternative(%Claim{}, %{field: value})
{:ok, %ClaimAlternative{}}

iex> create_claim_alternative(%Claim{}, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_column(claim_alternative, attrs \\ %{})

View Source

Creates a column.

Examples

iex> create_column(%Claim{} = claim, %{field: value})
{:ok, %Column{}}

iex> create_column(%Claim{} = claim, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

create_column_alternative(column, attrs \\ %{})

View Source

Creates a column_alternative.

Examples

iex> create_column_alternative(%Column{} = column, %{field: value})
{:ok, %ColumnAlternative{}}

iex> create_column_alternative(%Column{} = column, %{field: bad_value})
{:error, %Ecto.Changeset{}}

Deletes a claim.

Examples

iex> delete_claim(claim)
{:ok, %Claim{}}

iex> delete_claim(claim)
{:error, %Ecto.Changeset{}}
Link to this function

delete_claim_alternative(claim_alternative)

View Source

Deletes a claim alternative.

Examples

iex> delete_claim_alternative(claim)
{:ok, %ClaimAlternative{}}

iex> delete_claim_alternative(claim)
{:error, %Ecto.Changeset{}}

Deletes a column.

Examples

iex> delete_column(column)
{:ok, %Column{}}

iex> delete_column(column)
{:error, %Ecto.Changeset{}}
Link to this function

delete_column_alternative(column_alternative)

View Source

Deletes a column_alternative.

Examples

iex> delete_column_alternative(column_alternative)
{:ok, %ColumnAlternative{}}

iex> delete_column_alternative(column_alternative)
{:error, %Ecto.Changeset{}}

Gets the associated claims for a spec, preloaded with their child associations.

Examples

iex> get_by_spec(%Spec{})
[%Claim{}, ...]

Gets a single claim.

Raises Ecto.NoResultsError if the Claim does not exist.

Examples

iex> get_claim!(123)
%Claim{}

iex> get_claim!(456)
** (Ecto.NoResultsError)
Link to this function

get_claim_alternative!(id)

View Source

Gets a single claim alternative.

Raises Ecto.NoResultsError if the ClaimAlternative does not exist.

Examples

iex> get_claim_alternative!(123)
%ClaimAlternative{}

iex> get_claim_alternative!(456)
** (Ecto.NoResultsError)

Gets a single column.

Raises Ecto.NoResultsError if the Column does not exist.

Examples

iex> get_column!(123)
%Column{}

iex> get_column!(456)
** (Ecto.NoResultsError)
Link to this function

get_column_alternative!(id)

View Source

Gets a single column_alternative.

Raises Ecto.NoResultsError if the ColumnAlternative does not exist.

Examples

iex> get_column_alternative!(123)
%ColumnAlternative{}

iex> get_column_alternative!(456)
** (Ecto.NoResultsError)
Link to this function

init_claim_alternative_with_columns(columns, attrs)

View Source

Initialises a claim_alternative and its child columns at the same time.

Returns a changeset.

Examples

iex> init_claim_alternative_with_columns([%Column{}], %{field: value})
%Ecto.Changeset{}

iex> init_claim_alternative_with_columns(%Claim{}, [%Column{}], %{field: value})
%Ecto.Changeset{}
Link to this function

init_claim_alternative_with_columns(claim, columns, attrs)

View Source
Link to this function

init_claim_with_alternatives(alternatives, attrs \\ %{})

View Source

Initialises a claim with its alternatives.

Returns a changeset.

Examples

iex> init_claim_with_alternatives([%ClaimAlternative{}])
%Ecto.Changeset{}
Link to this function

init_column_alternative(attrs)

View Source

Initialise a column_alternative.

Examples

iex> init_column_alternative(%{field: value})
%Ecto.Changeset{}
Link to this function

init_column_with_alternatives(alternatives, attrs \\ %{})

View Source

Initialise a column.

Examples

iex> init_column_with_alternatives([%ColumnAlternative{}])
%Ecto.Changeset{}
Link to this function

list_claim_alternatives()

View Source

Returns the list of claim alternatives.

Examples

iex> list_claim_alternatives()
[%ClaimAlternative{}, ...]

Returns the list of claims.

Examples

iex> list_claims()
[%Claim{}, ...]
Link to this function

list_column_alternatives()

View Source

Returns the list of column_alternatives.

Examples

iex> list_column_alternatives()
[%ColumnAlternative{}, ...]

Returns the list of columns.

Examples

iex> list_columns()
[%Column{}, ...]

Coerce a list of claims to a {schema, table}: column_names map.

Examples

iex> to_columns_map([%Claim{}])
%{{schema, table}: [column_name, ...], ...}
Link to this function

update_claim(claim, attrs)

View Source

Updates a claim.

Examples

iex> update_claim(claim, %{field: new_value})
{:ok, %Claim{}}

iex> update_claim(claim, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_claim_alternative(claim_alternative, attrs)

View Source

Updates a claim alternative.

Examples

iex> update_claim_alternative(claim, %{field: new_value})
{:ok, %ClaimAlternative{}}

iex> update_claim_alternative(claim, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_column(column, attrs)

View Source

Updates a column.

Examples

iex> update_column(column, %{field: new_value})
{:ok, %Column{}}

iex> update_column(column, %{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

update_column_alternative(column_alternative, attrs)

View Source

Updates a column_alternative.

Examples

iex> update_column_alternative(column_alternative, %{field: new_value})
{:ok, %ColumnAlternative{}}

iex> update_column_alternative(column_alternative, %{field: bad_value})
{:error, %Ecto.Changeset{}}