View Source Statestores.Adapters.ProjectionBehaviour behaviour (spawn_statestores v2.0.0-RC5)

Defines the default behavior for each Projection Provider.

Summary

Types

data()

@type data() :: struct()

opts()

@type opts() :: Keyword.t()

params()

@type params() :: struct()

projection_type()

@type projection_type() :: module()

query()

@type query() :: String.t()

table_name()

@type table_name() :: String.t()

Callbacks

create_or_update_table(projection_type, table_name)

@callback create_or_update_table(projection_type(), table_name()) :: :ok

default_port()

@callback default_port() :: <<_::32>>

query(projection_type, query, params, opts)

@callback query(projection_type(), query(), params(), opts()) ::
  {:error, term()} | {:ok, data()}

upsert(projection_type, table_name, data)

@callback upsert(projection_type(), table_name(), data()) :: :ok