Aerospike.Cursor (Aerospike Driver v0.3.1)

Copy Markdown View Source

Opaque partition-resume cursor for paged queries.

Serialize with encode/1 for storage or URLs; restore with decode/1. The cursor captures partition progress, not a stable snapshot of the result set.

Summary

Types

t()

Partition resume cursor used by paged scans and queries.

Functions

Deserializes a cursor produced by encode/1.

Serializes a cursor to a URL-safe Base64 string.

Types

t()

@type t() :: %Aerospike.Cursor{
  partitions: [Aerospike.PartitionFilter.partition_entry()]
}

Partition resume cursor used by paged scans and queries.

Partition entries may carry the last digest and bval observed for each partition so a later page can resume partition-order traversal.

Functions

decode(encoded)

@spec decode(String.t()) :: {:ok, t()} | {:error, Aerospike.Error.t()}

Deserializes a cursor produced by encode/1.

Returns {:error, %Aerospike.Error{code: :parse_error}} when the string is not valid cursor data.

encode(cursor)

@spec encode(t()) :: String.t()

Serializes a cursor to a URL-safe Base64 string.

The encoded value is suitable for storage in application state or query parameters. It is driver-owned data; callers should treat it as opaque.

Raises ArgumentError if the cursor contains invalid partition entries.