type ArrowArray C.struct_ArrowArray Keys are []Key, viewed in place, and values are a Tape: bytes end to end around one more offset than values, as Apache Arrow lays them out. TapeOf packs strings or byte slices into a fresh tape, while U32Tape and U64Tape view bytes and offsets the caller already holds, without a copy.
A read answers Values, which addresses the tape in the arena rather than copying out of it, reports a missing key as absent, and passes the whole batch back through Values.Tape, so a tape a read wrote is written again as it is.
Since every result views the arena as Go slices, a verb into an arena whose Describe reports HostAccessRefused fails with StatusDevice before it runs, while managed memory and Apple’s shared memory read in place.
A write carries values and nothing else, so an empty value is still a value, and BlobsRemove removes keys, or ranges given end keys.
ada, grace, kent := ustore.KeyFromUint64(1), ustore.KeyFromUint64(2), ustore.KeyFromUint64(3)
err := database.BlobsWrite(people, []ustore.Key{ada, grace}, ustore.TapeOf("Ada", "Grace"), nil)
values, err := database.BlobsRead(people, []ustore.Key{ada, grace, kent}, arena, nil)
name, ok := values.Get(0) // "Ada", true
_, ok = values.Get(2) // false
headers, err := database.BlobsRead(people, []ustore.Key{ada}, arena, &ustore.BlobsReadConfig{Limits: []uint64{2}})
err = database.BlobsRemove(people, []ustore.Key{grace}, nil)API
Types
ArrowArrayArrowArray is the Arrow C data interface's array of one column, laid out as struct ArrowArray.
BlobsReadConfigBlobsReadConfig carries the optional arguments of DatabaseOn.BlobsRead.
type BlobsReadConfig struct {
Offsets []uint64
Limits []uint64
} Fields
Offsets | []uint64 | Offsets are the byte offsets into every value the read starts at, one per key, or whole values when empty. |
|---|---|---|
Limits | []uint64 | Limits cap the bytes read of every value from its offset, one per key, or the rest when empty. |
BlobsScanConfigBlobsScanConfig carries the optional arguments of DatabaseOn.BlobsScan.
type BlobsScanConfig struct {
StartKeys []Key
EndKeys []Key
Direction ScanDirection
Patterns Patterns
Predicate Admitter
Mode ScanMode
Progress ProgressCallback
} Fields
StartKeys | []Key | StartKeys are the inclusive starts of the scans, one per task, or the first key in Direction when empty. |
|---|---|---|
EndKeys | []Key | EndKeys are the keys every scan stops before, one per task, or no bound when empty. |
Direction | ScanDirection | Direction is which way every scan goes from its start. |
Patterns | Patterns | Patterns keep the keys whose values match, shared by every scan. |
Predicate | Admitter | Predicate admits or passes over the listed keys. |
Mode | ScanMode | Mode is in what order the keys come. |
Progress | ProgressCallback | Progress reports the scans finished, and may cancel the call. |
IngestRowsIngestRows is one batch of rows: keys and values for blobs, documents and pages, values as the strings and keys as what they map onto for strings, and sources, targets and optional edge identifiers for graphs.
type IngestRows struct {
Keys []Key
Values Tape
Sources []Key
Targets []Key
Edges []Key
} Fields
Keys | []Key | Keys are the keys of blobs, documents and pages, or the keys strings map onto. |
|---|---|---|
Values | Tape | Values are the values of blobs, JSON documents and XML pages, or the strings of a strings collection. |
Sources | []Key | Sources are the sources of edges. |
Targets | []Key | Targets are the targets of edges. |
Edges | []Key | Edges are the identifiers of edges, or nothing for the default identifier of each. |
RemoveConfigRemoveConfig carries the optional arguments of a removal by key or by range.
type RemoveConfig struct {
EndKeys []Key
Durability Durability
} Fields
EndKeys | []Key | EndKeys turns every key into the inclusive start of a range ending before its end key, one per task, or removes the keys alone when empty. |
|---|---|---|
Durability | Durability | Durability is how durable the removals are once the call finishes at the head. |
StringsCursorConfigStringsCursorConfig carries the optional arguments of DatabaseOn.StringsCursorInit.
type StringsCursorConfig struct {
Prefix string
StartString string
EndString string
Direction ScanDirection
Patterns Patterns
Predicate Admitter
} Fields
Prefix | string | Prefix is what every string the walk returns starts with, or nothing to match every string. |
|---|---|---|
StartString | string | StartString is where the walk starts, inclusive, or the first string of the prefix in Direction when empty. |
EndString | string | EndString is the string the walk stops before, or no bound when empty. |
Direction | ScanDirection | Direction is which way the walk goes from its start. |
Patterns | Patterns | Patterns keep the strings matching, compiled once. |
Predicate | Admitter | Predicate admits or passes over the keys of every page. |
StringsLayoutStringsLayout is the layout a tape of strings exports as.
type StringsLayout int32 Values
StringsU32Tape | StringsU32Tape is Arrow's binary layout, with 32-bit offsets. | |
|---|---|---|
StringsU64Tape | StringsU64Tape is Arrow's large binary layout, with 64-bit offsets. |
StringsMeasureConfigStringsMeasureConfig carries the optional arguments of DatabaseOn.StringsMeasure.
type StringsMeasureConfig struct {
StartStrings Tape
EndStrings Tape
Direction ScanDirection
} Fields
StartStrings | Tape | StartStrings are the inclusive starts of the ranges, one per task, or the first string in Direction when empty. |
|---|---|---|
EndStrings | Tape | EndStrings are the strings every range stops before, one per task, or no bound when empty. |
Direction | ScanDirection | Direction is which way every range goes from its start. |
StringsRemoveConfigStringsRemoveConfig carries the optional arguments of DatabaseOn.StringsRemove.
type StringsRemoveConfig struct {
EndStrings Tape
Durability Durability
} Fields
EndStrings | Tape | EndStrings turns every string into the inclusive start of a range ending before its end string, one per task, or removes the strings alone when empty. |
|---|---|---|
Durability | Durability | Durability is how durable the removals are once the call finishes at the head. |
StringsScanConfigStringsScanConfig carries the optional arguments of DatabaseOn.StringsScan.
type StringsScanConfig struct {
Prefixes Tape
StartStrings Tape
EndStrings Tape
Direction ScanDirection
Patterns Patterns
Predicate Admitter
Mode ScanMode
Progress ProgressCallback
} Fields
Prefixes | Tape | Prefixes every scan matches, one per task, or every string when empty. |
|---|---|---|
StartStrings | Tape | StartStrings are the inclusive starts of the scans, one per task, or the first string in Direction when empty. |
EndStrings | Tape | EndStrings are the strings every scan stops before, one per task, or no bound when empty. |
Direction | ScanDirection | Direction is which way every scan goes from its start. |
Patterns | Patterns | Patterns keep the strings matching, shared by every scan. |
Predicate | Admitter | Predicate admits or passes over the keys the listed strings map onto. |
Mode | ScanMode | Mode is in what order the strings come. |
Progress | ProgressCallback | Progress reports the scans finished, and may cancel the call. |
WriteConfigWriteConfig carries the optional arguments of a write that takes nothing else.
type WriteConfig struct {
Durability Durability
} Fields
Durability | Durability | Durability is how durable the writes are once the call finishes at the head. |
|---|
TypeArrowDeviceArrayArrowDeviceArray is an ArrowArray beside the device its buffers live on, laid out as struct ArrowDeviceArray.2
type ArrowDeviceArray C.struct_ArrowDeviceArray ArrayArray reports the column itself, which the converters read as they read a host array.
func (array *ArrowDeviceArray) Array() *ArrowArray ReleaseRelease hands the array back to its producer, once; a released array is safe to release again.
func (array *ArrowDeviceArray) Release() TypeArrowSchemaArrowSchema is the Arrow C data interface's schema of one column, laid out as struct ArrowSchema, so any Arrow library reads it through its address.1
type ArrowSchema C.struct_ArrowSchema ReleaseRelease hands the schema back to its producer, once; a released schema is safe to release again.
func (schema *ArrowSchema) Release() EnumDurabilityDurability is how durable a write at the head is once the call finishes; a transaction's commit decides its own.2
type Durability int32 Values
DurabilityBuffered | DurabilityBuffered is visible on return and durable at the next flush. | |
|---|---|---|
DurabilityFlushed | DurabilityFlushed is durable on return. |
DurabilityFromNameDurabilityFromName reads a durability back from the spelling Durability.String renders.
func DurabilityFromName(name string) (Durability, error) StringString renders the durability as the library spells it.
func (durability Durability) String() string EnumIngestOrderIngestOrder is in what order an ingest's rows arrive.2
type IngestOrder int32 Values
IngestSorted | IngestSorted takes keys strictly ascending across every append. | |
|---|---|---|
IngestUnsorted | IngestUnsorted takes keys in any order, the last row of a key winning. |
IngestOrderFromNameIngestOrderFromName reads an ingest order back from the spelling IngestOrder.String renders.
func IngestOrderFromName(name string) (IngestOrder, error) StringString renders the order as the library spells it.
func (order IngestOrder) String() string StructListingListing is what a batch of string scans or samples wrote into its arena, strings scan after scan, readable until the arena serves another call.4
type Listing struct {
// contains filtered or unexported fields
} CountCount reports how many strings scan task found.
func (listing Listing) Count(task uint) uint GetGet views string index of scan task in the arena; index must be below Listing.Count.
func (listing Listing) Get(task, index uint) []byte LenLen reports how many scans or samples the call ran.
func (listing Listing) Len() uint ScoresScores views the BM25 score of every string scan task found, and nothing unless the patterns carried weights.
func (listing Listing) Scores(task uint) []float32 StructMappedMapped is the key every string a read looked up maps onto, in the order of the strings, readable until the arena serves another call.2
type Mapped struct {
// contains filtered or unexported fields
} GetGet reports the key string index maps onto, and false for a missing string.
func (mapped Mapped) Get(index uint) (Key, bool) LenLen reports how many strings the call looked up.
func (mapped Mapped) Len() uint StructStringsStrings is a ragged batch a call wrote into its arena as a tape, readable until the arena serves another call.3
type Strings struct {
// contains filtered or unexported fields
} GetGet views string index in the arena; index must be below Strings.Len.
func (strings Strings) Get(index uint) []byte LenLen reports how many strings the call wrote.
func (strings Strings) Len() uint TapeTape passes the strings back as an input, so a tape one call wrote is written again as it is, valid while the arena holds it.
func (strings Strings) Tape() Tape StructStringsPageStringsPage is one pull of a strings walk, written into its arena and readable until the arena serves another call.3
type StringsPage struct {
// contains filtered or unexported fields
} LenLen reports how many strings the pull handed out; fewer than wanted exhausts the walk for good.
func (page StringsPage) Len() uint StringsStrings views the strings of the page in the arena.
func (page StringsPage) Strings() Strings ValuesValues views the key every string maps onto, and is empty after a StringsCursor.NextStrings pull.
func (page StringsPage) Values() []Key StructTapeTape passes a ragged batch of byte strings as Apache Arrow lays one out: the bytes end to end, and one more offset than strings around them, string i spanning offsets[i] up to offsets[i+1].5
type Tape struct {
// contains filtered or unexported fields
} A Tape views and never owns, and the binding pins both slices until each call it crosses is final. The zero Tape is the empty batch, which a verb reads as its input's default.
StringsViewFromArrowStringsViewFromArrow views the byte strings of a binary, utf8, large binary or large utf8 column in place as a Tape, viewing the column's buffers.
func StringsViewFromArrow(
schema *ArrowSchema,
array *ArrowArray,
) (Tape, error) TapeOfTapeOf packs strings end to end into a fresh Tape, one entry apiece, with 32-bit offsets while the bytes fit in 4 GiB and 64-bit beyond.
func TapeOf[Text ~string | ~[]byte](texts ...Text) Tape U32TapeU32Tape views bytes end to end around len(offsets) - 1 strings, in Arrow's binary layout.
func U32Tape(data []byte, offsets []uint32) Tape Panics when the offsets overrun the bytes, which names a caller's arithmetic mistake rather than a condition the library could report.
U64TapeU64Tape views bytes end to end around len(offsets) - 1 strings, in Arrow's large binary layout.
func U64Tape(data []byte, offsets []uint64) Tape Panics when the offsets overrun the bytes.
LenLen reports how many strings the tape spans.
func (tape Tape) Len() uint StructValuesValues is a batch of values a read wrote into its arena, in the order of its keys, readable until the arena serves another call.3
type Values struct {
// contains filtered or unexported fields
} GetGet views value index in the arena, and false for a missing key.
func (values Values) Get(index uint) ([]byte, bool) LenLen reports how many values the call read.
func (values Values) Len() uint TapeTape passes every value back as an input, a missing key as an empty value, so a read's tape is written again as it is.
func (read Values) Tape() Tape Functions
KeysViewToArrowKeysViewToArrow exports keys a call wrote into arena as one fixed_size_binary(16) column tagged arrow.uuid, in place; until both outputs are released, the arena's next call and Close answer StatusContended, so release them after reading.
func KeysViewToArrow(
keys []Key,
arena *Arena,
schema *ArrowSchema,
array *ArrowDeviceArray,
) error StringsViewToArrowStringsViewToArrow exports strings a call wrote into arena as one binary or large binary column, in place when the tape already has layout; until both outputs are released, the arena's next call and Close answer StatusContended.
func StringsViewToArrow(
strings Strings,
layout StringsLayout,
arena *Arena,
schema *ArrowSchema,
array *ArrowDeviceArray,
) error