# `EctoFoundationDB.Versionstamp`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L1)

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)

# `from_binary`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L92)

# `from_integer`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L85)

# `get`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L52)

# `incomplete`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L37)

# `incomplete?`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L41)

# `max`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L38)

# `min`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L39)

# `next`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L97)

# `next`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L107)

# `resolve`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L111)

# `to_integer`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L56)

# `type?`
[🔗](https://github.com/foundationdb-beam/ecto_foundationdb/blob/main/lib/ecto_foundationdb/versionstamp.ex#L49)

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

---

*Consult [api-reference.md](api-reference.md) for complete listing*
