EctoGSS.Repo (ecto_gss v0.3.5)

Repository to use Google Spreadsheets as persistence layer for objects.

Link to this section Summary

Functions

Get several records

Returns a specification to start this module under a supervisor.

Delete an existing record.

Delete an existing record, raise in case of error.

Get a record by row id, raise if not found.

Get a record by row, raise if not found.

Callback implementation for GenServer.init/1.

Add a new record.

Add a new record, raise in case of error.

Update an existing record, or insert a new one.

Update an existing record, or insert a new one, raise in case of error.

Update an existing record with a row id.

Update an existing record, raise in case of error.

Link to this section Types

Link to this type

ecto_object()

Specs

ecto_object() :: Ecto.Changeset.t() | Ecto.Schema.t()

Specs

result() :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Specs

state() :: map()

Link to this section Functions

Link to this function

all(schema, opts \\ [])

Specs

Get several records:

  • by range of rows: start_id and end_id options;
  • by exact list of rows: rows option.
Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

delete(ecto_object()) :: result()

Delete an existing record.

Link to this function

delete!(record)

Specs

delete!(ecto_object()) :: Ecto.Schema.t() | no_return()

Delete an existing record, raise in case of error.

Link to this function

get(schema, id)

Specs

get(Ecto.Queryable.t(), integer()) :: Ecto.Schema.t() | nil | no_return()

Get a record by row id, raise if not found.

Link to this function

get!(schema, id)

Specs

get!(Ecto.Queryable.t(), integer() | nil) :: Ecto.Schema.t() | no_return()

Get a record by row, raise if not found.

Specs

init(state()) :: {:ok, state()}

Callback implementation for GenServer.init/1.

Link to this function

insert(changeset)

Specs

insert(ecto_object()) :: result()

Add a new record.

Link to this function

insert!(changeset)

Specs

insert!(ecto_object()) :: Ecto.Schema.t() | no_return()

Add a new record, raise in case of error.

Link to this function

insert_or_update(changeset)

Specs

insert_or_update(Ecto.Changeset.t()) :: result()

Update an existing record, or insert a new one.

Link to this function

insert_or_update!(changeset)

Specs

insert_or_update!(Ecto.Changeset.t()) :: Ecto.Schema.t() | no_return()

Update an existing record, or insert a new one, raise in case of error.

Specs

start_link() :: {:ok, pid()}
Link to this function

update(changeset)

Specs

update(ecto_object()) :: {:ok, Ecto.Schema.t()} | {:error, Ecto.Changeset.t()}

Update an existing record with a row id.

Link to this function

update!(changeset)

Specs

Update an existing record, raise in case of error.