View Source EctoFoundationDB.Indexer.SchemaMetadata (Ecto.Adapters.FoundationDB v0.6.2)

This is Indexer keeps track of various actions for a Schema:

  • inserts: Incremented for each insert or upsert
  • deletes: Incremented for each delete
  • collection: Incremented for each insert, upsert, or delete
  • updates: Incremented for each update (via Repo.update/*)
  • changes: Incremented for each insert, upsert, delete, or update

These keys are useful for creating watches that will notify your application of those actions. For example, if you create a watch on the inserts key, your application will be notified when a new record is inserted, and you can react however you like.

See it in action: Sync Engine Part II - Collections

Summary

Functions

Asynchronously get the changes key.

Asynchronously get the changes key.

Asynchronously get the collection key.

Asynchronously get the collection key.

Asynchronously get the deletes key.

Asynchronously get the deletes key.

Asynchronously get the inserts key.

Asynchronously get the inserts key.

Asynchronously get the updates key.

Asynchronously get the updates key.

Synchronous get on the changes key.

Synchronous get on the changes key for the provided indexed values.

Synchronous get on the collection key.

Synchronous get on the collection key for the provided indexed values.

Synchronous get on the deletes key.

Synchronous get on the deletes key for the provided indexed values.

Synchronous get on the inserts key.

Synchronous get on the inserts key for the provided indexed values.

Synchronous get on the updates key.

Synchronous get on the updates key for the provided indexed values.

Creates a watch on the provided SchemaMetadata named key.

Equivalent to watch(schema, :changes, opts)

Equivalent to watch_by(schema, indexed_values, :changes, opts)

Equivalent to watch(schema, :collection, opts)

Equivalent to watch_by(schema, indexed_values, :collection, opts)

Equivalent to watch(schema, :deletes, opts)

Equivalent to watch_by(schema, indexed_values, :deletes, opts)

Equivalent to watch(schema, :inserts, opts)

Equivalent to watch_by(schema, indexed_values, :inserts, opts)

Equivalent to watch(schema, :updates, opts)

Equivalent to watch_by(schema, indexed_values, :updates, opts)

Functions

Asynchronously get the changes key.

Link to this function

async_changes_by(schema, by)

View Source

Asynchronously get the changes key.

Link to this function

async_collection(schema)

View Source

Asynchronously get the collection key.

Link to this function

async_collection_by(schema, by)

View Source

Asynchronously get the collection key.

Asynchronously get the deletes key.

Link to this function

async_deletes_by(schema, by)

View Source

Asynchronously get the deletes key.

Asynchronously get the inserts key.

Link to this function

async_inserts_by(schema, by)

View Source

Asynchronously get the inserts key.

Asynchronously get the updates key.

Link to this function

async_updates_by(schema, by)

View Source

Asynchronously get the updates key.

Synchronous get on the changes key.

Link to this function

changes_by(schema, indexed_values, opts)

View Source

Synchronous get on the changes key for the provided indexed values.

Link to this function

clear_by(schema, indexed_values)

View Source
Link to this function

collection(schema, opts)

View Source

Synchronous get on the collection key.

Link to this function

collection_by(schema, indexed_values, opts)

View Source

Synchronous get on the collection key for the provided indexed values.

Synchronous get on the deletes key.

Link to this function

deletes_by(schema, indexed_values, opts)

View Source

Synchronous get on the deletes key for the provided indexed values.

Synchronous get on the inserts key.

Link to this function

inserts_by(schema, indexed_values, opts)

View Source

Synchronous get on the inserts key for the provided indexed values.

Synchronous get on the updates key.

Link to this function

updates_by(schema, indexed_values, opts)

View Source

Synchronous get on the updates key for the provided indexed values.

Link to this function

watch(queryable, name, opts \\ [])

View Source

Creates a watch on the provided SchemaMetadata named key.

Arguments

  • queryable: The schema to watch, or a query
  • name: The name of the watch
  • opts: The options for the watch

Name

  • :inserts: Signals for each insert or upsert
  • :deletes: Signals for each delete
  • :collection: Signals for each insert, upsert, or delete
  • :updates: Signals for each update (via Repo.update/*)
  • :changes: Signals for each insert, upsert, delete, or update

Options

  • :label: An optional atom label that if provided, will be used by subsequent calls to Repo.assign_ready/3 to store the data into the assigns map. There is no default behavior. If a label is not provided, assign_ready will fail. to Repo.assign_ready/3 to query the database for data to be stored in the assigns map. By default, Repo.all(schema) is used.
Link to this function

watch_by(queryable, indexed_values, name, opts \\ [])

View Source
Link to this function

watch_changes(schema, opts \\ [])

View Source

Equivalent to watch(schema, :changes, opts)

Link to this function

watch_changes_by(schema, indexed_values, opts \\ [])

View Source

Equivalent to watch_by(schema, indexed_values, :changes, opts)

Link to this function

watch_collection(schema, opts \\ [])

View Source

Equivalent to watch(schema, :collection, opts)

Link to this function

watch_collection_by(schema, indexed_values, opts \\ [])

View Source

Equivalent to watch_by(schema, indexed_values, :collection, opts)

Link to this function

watch_deletes(schema, opts \\ [])

View Source

Equivalent to watch(schema, :deletes, opts)

Link to this function

watch_deletes_by(schema, indexed_values, opts \\ [])

View Source

Equivalent to watch_by(schema, indexed_values, :deletes, opts)

Link to this function

watch_inserts(schema, opts \\ [])

View Source

Equivalent to watch(schema, :inserts, opts)

Link to this function

watch_inserts_by(schema, indexed_values, opts \\ [])

View Source

Equivalent to watch_by(schema, indexed_values, :inserts, opts)

Link to this function

watch_updates(schema, opts \\ [])

View Source

Equivalent to watch(schema, :updates, opts)

Link to this function

watch_updates_by(schema, indexed_values, opts \\ [])

View Source

Equivalent to watch_by(schema, indexed_values, :updates, opts)