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).