EctoFoundationDB.Indexer behaviour (Ecto.Adapters.FoundationDB v0.7.7)

Copy Markdown View Source

Implement this behaviour to create a custom index.

Each Indexer has access to read, write, and clear any and all data in the database. A faulty implementation may lead to data loss or corruption.

Summary

Types

The schema module an index is defined on -- the module itself, not a struct built from it. Implementations call c:Ecto.Schema.__schema__/1 on it to reach field names and types.

Types

schema()

@type schema() :: module()

The schema module an index is defined on -- the module itself, not a struct built from it. Implementations call c:Ecto.Schema.__schema__/1 on it to reach field names and types.

Callbacks

clear(t, transaction, t, schema, tuple)

create(t, transaction, t, schema, tuple, integer)

create_range(t, t)

drop_ranges(t, t)

range(t, t, t)

set(t, transaction, t, schema, tuple)

unpack(t, t, tuple)

(optional)

update(t, transaction, t, schema, tuple, t)

(optional)

Functions

clear(tenant, tx, metadata, schema, kv)

create(tenant, tx, idx, schema, range, limit)

create_range(tenant, idx)

drop_ranges(tenant, idx)

range(idx, plan, options)

set(tenant, tx, metadata, schema, kv)

unpack(idx, plan, fdb_kv)

update(tenant, tx, metadata, schema, kv, updates)