EctoFoundationDB.Versionstamp (Ecto.Adapters.FoundationDB v0.7.5)

Copy Markdown View Source

Versionstamping is a feature that allows you to create a identifier for a record that is guaranteed to be unique across all records in the database.

Please refer to the documentation for Repo.async_insert_all!/3 for instructions on how to insert records with a Versionstamp primary key.

Partition-by option

When used as a primary key type, an optional partition_by: option can be provided to co-locate records with the same field value in the same keyspace:

@primary_key {:id, {EctoFoundationDB.Versionstamp, partition_by: :user_id}, autogenerate: false}

This enables efficient single-partition range scans:

from(s in Session, where: s.id >= ^{"alice", checkpoint} and s.id < ^{"alice", Versionstamp.max()})
|> Repo.all(prefix: tenant)

Summary

Functions

Returns true if the given value is a parameterized Versionstamp type term, as returned by schema.__schema__(:type, field).

Functions

from_binary(bin)

from_integer(int)

get(tx)

incomplete(user)

incomplete?(arg1)

max()

min()

next()

next(tx)

resolve(arg1, arg2)

to_integer(vs)

type?(arg1)

Returns true if the given value is a parameterized Versionstamp type term, as returned by schema.__schema__(:type, field).