View Source Rivet.Ident.Access (rivet_ident v3.1.2)

Schema for representing and working with a Ident.Access.

Summary

Functions

change_post for side effects; should return the item

change_prep alters the params only, and may only return {:ok, params}

change_validate is only run for changing existing records

create_post for side effects; should return the item

create_prep alters the params only, and may only return {:ok, params}

create_validate is only run for creating new records

Similar to replace, but it doesn't remove existing values if the attrs has nil

Update our updated_at but only if it hasn't changed within a minute (less load)

a hook if you just want to extend validate

Types

@type ecto_p_result() :: {:ok | :error, Ecto.Changeset.t()}
@type id() :: Ecto.UUID.t()
@type model_p_result() :: {:ok, Rivet.Ident.Access.t()}
@type t() :: %Rivet.Ident.Access{
  __meta__: Ecto.Schema.Metadata.t(),
  domain: Rivet.Utils.Ecto.Atom.t() | nil,
  id: integer() | nil,
  ref_id: binary() | nil,
  role: Ecto.Schema.belongs_to(Rivet.Ident.Role.t()) | nil,
  role_id: integer() | nil,
  user: Ecto.Schema.belongs_to(Rivet.Ident.User.t()) | nil,
  user_id: binary() | nil
}

Functions

Link to this function

all(clauses \\ [], args \\ [])

View Source
@spec all(keyword() | Ecto.Query.t(), list()) ::
  {:error, ecto_p_result()} | {:ok, [Rivet.Ident.Access.t()]}
Link to this function

all!(clauses \\ [], args \\ [])

View Source
@spec all!(keyword() | Ecto.Query.t(), list()) :: [Rivet.Ident.Access.t()]
Link to this function

associate(item, var, value)

View Source
Link to this function

change_post(item, params)

View Source

change_post for side effects; should return the item

Note: BE VERY CAREFUL on large impact effects. This can quickly become a performance bottleneck.

Link to this function

change_prep(item, params)

View Source

change_prep alters the params only, and may only return {:ok, params}

change_validate is only run for changing existing records

Link to this function

count_by_inserted!(since)

View Source
Link to this function

count_by_updated!(since)

View Source
@spec create(map()) :: model_p_result() | ecto_p_result()
Link to this function

create_post(item, params)

View Source

create_post for side effects; should return the item

Note: BE VERY CAREFUL on large impact effects. This can quickly become a performance bottleneck.

Link to this function

create_prep(item, params)

View Source

create_prep alters the params only, and may only return {:ok, params}

create_validate is only run for creating new records

Link to this function

delete_all(clauses, opts \\ [])

View Source
Link to this function

delete_all_ids(ids, opts \\ [])

View Source
Link to this function

drop_replace(attrs, clauses)

View Source
@spec drop_replace(map(), Keyword.t()) :: model_p_result() | ecto_p_result()
@spec exists?(claims_or_query :: keyword() | term()) :: true | false
Link to this function

full_table_scan(clauses, func)

View Source
Link to this function

latest(claims \\ [], x \\ 1)

View Source
Link to this function

latest!(claims \\ [], x \\ 1)

View Source
@spec one(id() | keyword() | Ecto.Query.t(), preload :: list()) ::
  {:ok, Rivet.Ident.Access.t()} | {:error, String.t()}
@spec one!(id() | keyword() | Ecto.Query.t(), preload :: list()) ::
  nil | Rivet.Ident.Access.t()
Link to this function

preload(item, preloads, opts \\ [])

View Source
@spec preload(Rivet.Ident.Access.t(), preloads :: term(), opts :: Keyword.t()) ::
  model_p_result() | ecto_p_result()
Link to this function

preload!(item, preloads, opts \\ [])

View Source
@spec preload!(Rivet.Ident.Access.t(), preloads :: term(), opts :: Keyword.t()) ::
  Rivet.Ident.Access.t()
@spec replace(map(), Keyword.t()) :: model_p_result() | ecto_p_result()
Link to this function

replace_fill(attrs, clauses)

View Source
@spec replace_fill(map(), Keyword.t()) :: model_p_result() | ecto_p_result()

Similar to replace, but it doesn't remove existing values if the attrs has nil

Update our updated_at but only if it hasn't changed within a minute (less load)

Link to this function

update_all(clauses, set)

View Source
Link to this function

update_fill(item, attrs)

View Source
@spec update_fill(Rivet.Ident.Access.t(), attrs :: map()) ::
  model_p_result() | ecto_p_result()
Link to this function

upsert(attrs, on_conflict \\ :nothing)

View Source

a hook if you just want to extend validate