riptide v0.4.4 Riptide.Store behaviour View Source

Riptide stores are where data can be written to and read from. This module provides a behavior that can be implemented to integrate any data store with Riptide. Regardless of the underlying store, Riptide consistently provides a tree data model

The following stores are available out of the box. Visit their

Configuration

Stores can be assigned via configuration. Riptide supports specifying different stores for reads and for writes although typically you will configure the same for both:

config :riptide,
  store: %{
    read: {Riptide.Store.MyStore, option1: "test"},
    write: {Riptide.Store.MyStore, option1: "test"}
  }

Link to this section Summary

Functions

Initialize all configured stores

Apply mutation to configured write store. Does not trigger interceptors.

Apply mutation to specified store with opts. Does not trigger interceptors.

Processes query with configured read store. Does not trigger interceptors.

Processes query with specified store with opts. Does not trigger interceptors.

Stream data from configured read store.

Stream data from specified read store with opts.

Link to this section Functions

Initialize all configured stores

Apply mutation to configured write store. Does not trigger interceptors.

Link to this function

mutation(mut, store, opts)

View Source

Apply mutation to specified store with opts. Does not trigger interceptors.

Processes query with configured read store. Does not trigger interceptors.

Link to this function

query(query, store, store_opts)

View Source

Processes query with specified store with opts. Does not trigger interceptors.

Link to this function

stream(path, opts \\ %{})

View Source

Stream data from configured read store.

Link to this function

stream(path, opts, store, store_opts)

View Source

Stream data from specified read store with opts.

Link to this section Callbacks

Link to this callback

init(opts)

View Source
init(opts :: any()) :: :ok | {:error, atom()}
Link to this callback

mutation(merges, deletes, opts)

View Source
mutation(merges :: any(), deletes :: any(), opts :: any()) ::
  :ok | {:error, atom()}
Link to this callback

query(paths, opts)

View Source
query(paths :: any(), opts :: any()) :: any()