ffi

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ffi binds the subset of the lance-c C ABI used by lance-go.

Responsibility split: this package owns native calls, native error extraction and the purego bindings. Library discovery and loading belong to internal/loader; Arrow C Data structures will belong to internal/cdata.

Threading contract: lance-c stores its last error in Rust thread-local storage. Every native call that can set an error must run while the goroutine is locked to its OS thread, and lance_last_error_code must be read before lance_last_error_message. Reading the message takes the pending error out of TLS, so a later code read would incorrectly report success. The returned message is owned by lance-c and must be copied and then released with lance_free_string; reading it after the free would be a use-after-free.

Only the minimal dataset open/close surface is bound in this foundation slice. Do not add empty bindings or public stubs ahead of the features that use them.

Index

Constants

View Source
const (
	FileSchedulerAuto     int32 = 0
	FileSchedulerStandard int32 = 1
	FileSchedulerLite     int32 = 2
)

Variables

View Source
var ErrClosed = errors.New("ffi: native handle is closed")

ErrClosed reports use of a native handle after it was closed.

Functions

func BlobField

func BlobField(name string, nullable bool) (arrow.Field, error)

BlobField exports the native blob v2 field with default thresholds.

func BlobFieldWithOptions

func BlobFieldWithOptions(name string, nullable bool, options BlobFieldOptions) (arrow.Field, error)

BlobFieldWithOptions exports the native blob v2 field with explicit threshold options. Nil thresholds select native defaults.

func BuildRQModel

func BuildRQModel(dimension, numBits uint32) ([]byte, error)

BuildRQModel returns the library JSON for an IVF-RQ rotation model.

func CommitBatch

func CommitBatch(uri string, txs []*Transaction, opts CommitOptions) (*Dataset, *Transaction, error)

CommitBatch publishes append transactions through CommitBuilder::execute_batch.

func CommitBatchWithAccessor

func CommitBatchWithAccessor(uri string, txs []*Transaction, opts CommitOptions, accessor *StorageOptionsAccessor) (*Dataset, *Transaction, error)

CommitBatchWithAccessor publishes append transactions using a reusable storage options accessor. The returned dataset retains the accessor.

func CommitBatchWithAccessorAndCommitLock

func CommitBatchWithAccessorAndCommitLock(uri string, txs []*Transaction, opts CommitOptions, accessor *StorageOptionsAccessor, lock *CommitLock) (*Dataset, *Transaction, error)

CommitBatchWithAccessorAndCommitLock publishes append transactions through an external commit lock. The accessor may be nil; static storage options are not accepted on this path.

func DecodeStringMap

func DecodeStringMap(raw string) (map[string]string, error)

decodeStringMap decodes a native JSON object containing string keys and string values. The native API returns complete maps, so an empty object is a valid empty map rather than a nil result.

func SessionHandle

func SessionHandle(s *Session) uintptr

SessionHandle returns the native handle for a native call that borrows a session. The caller must keep s alive until the call returns.

func ValidateStorageOptions

func ValidateStorageOptions(values map[string]string) error

ValidateStorageOptions checks the presence-independent part of a storage options map before any native or callback context is allocated.

Types

type AutoCleanupParams

type AutoCleanupParams struct {
	Interval         uint64
	OlderThanSeconds int64
	OlderThanNanos   int32
}

AutoCleanupParams mirrors LanceAutoCleanupParams.

type BasePath

type BasePath struct {
	ID            uint32
	Path          string
	Name          *string
	IsDatasetRoot bool
}

BasePath is one native base-path registration.

ID zero requests native ID allocation. A nil Name maps to native None; a non-nil Name, including a pointer to an empty string, is an explicit name.

type BaseStoreParams

type BaseStoreParams struct {
	StorageOptionsAccessor     *StorageOptionsAccessor
	BlockSize                  *uint64
	S3CredentialsRefreshOffset *time.Duration
	UseConstantSizeUploadParts *bool
	ListIsLexicallyOrdered     *bool
}

BaseStoreParams mirrors the representable fields of native ObjectStoreParams for one registered base path.

type BatchInfo

type BatchInfo struct {
	FragmentID uint32
	BatchIndex uint64
}

BatchInfo identifies one cached batch of one fragment during a batch UDF.

type BatchUDF

type BatchUDF struct {
	Mapper       func(arrow.RecordBatch) (arrow.RecordBatch, error)
	OutputSchema *cdata.ArrowSchema
	Store        BatchUDFStore
}

BatchUDF is the native-facing batch UDF configuration.

type BatchUDFStore

type BatchUDFStore interface {
	GetBatch(info BatchInfo) (arrow.RecordBatch, bool, error)
	InsertBatch(info BatchInfo, batch arrow.RecordBatch) error
	GetFragment(fragmentID uint32) (string, bool, error)
	InsertFragment(fragmentID uint64, fragmentJSON string) error
}

BatchUDFStore is the checkpoint store used by a batch UDF. Every method is required. InsertBatch receives the exact native batch schema, including opaque schema metadata that native uses to validate cached batches. Keep the batch and its schema together and return the retained batch from GetBatch; rebuilding it from the declared output schema drops the opaque metadata and native rejects the hit. Batches passed to InsertBatch are borrowed for the call; retain a batch before keeping it beyond the return. Batches returned by GetBatch are owned by the adapter and released after the callback exports them.

type BlobDescriptorBuilder

type BlobDescriptorBuilder struct {
	// contains filtered or unexported fields
}

BlobDescriptorBuilder builds one native prepared blob descriptor column.

func NewBlobDescriptorBuilder

func NewBlobDescriptorBuilder(column string) (*BlobDescriptorBuilder, error)

NewBlobDescriptorBuilder creates a native descriptor builder for column.

func (*BlobDescriptorBuilder) AppendDedicated

func (bld *BlobDescriptorBuilder) AppendDedicated(blobID uint32, length uint64) error

AppendDedicated appends one dedicated descriptor.

func (*BlobDescriptorBuilder) AppendExternal

func (bld *BlobDescriptorBuilder) AppendExternal(baseID uint32, uri string, offset, length uint64) error

AppendExternal appends one external descriptor with an explicit base ID.

func (*BlobDescriptorBuilder) AppendInline

func (bld *BlobDescriptorBuilder) AppendInline(data []byte) error

AppendInline appends one owned inline descriptor.

func (*BlobDescriptorBuilder) AppendManaged

func (bld *BlobDescriptorBuilder) AppendManaged(uri string, offset, length uint64, baseID *uint32) error

AppendManaged appends one managed descriptor. A nil baseID selects the native None variant; a pointer selects Some, including Some(0).

func (*BlobDescriptorBuilder) AppendNull

func (bld *BlobDescriptorBuilder) AppendNull() error

AppendNull appends one null blob descriptor.

func (*BlobDescriptorBuilder) AppendPacked

func (bld *BlobDescriptorBuilder) AppendPacked(blobID uint32, offset, length uint64) error

AppendPacked appends one packed descriptor.

func (*BlobDescriptorBuilder) Close

func (bld *BlobDescriptorBuilder) Close()

Close frees the native builder handle. It is safe after Finish.

func (*BlobDescriptorBuilder) ExtendPacked

func (bld *BlobDescriptorBuilder) ExtendPacked(blobID uint32, ranges []BlobRange) error

ExtendPacked appends packed descriptors in order. Native keeps the already appended prefix if a later range fails.

func (*BlobDescriptorBuilder) Field

func (bld *BlobDescriptorBuilder) Field() (arrow.Field, error)

Field exports the prepared field owned by the builder. It remains available after Finish until Close releases the builder.

func (*BlobDescriptorBuilder) Finish

func (bld *BlobDescriptorBuilder) Finish() (arrow.Array, arrow.Field, error)

Finish consumes the native builder and returns the owned prepared array and field. The caller must release the array.

func (*BlobDescriptorBuilder) PushExternal

func (bld *BlobDescriptorBuilder) PushExternal(uri string, hasRange bool, offset, length uint64) error

PushExternal appends an external descriptor through native push_external. A false hasRange stores offset 0 and length 0.

type BlobFieldOptions

type BlobFieldOptions struct {
	InlineSizeThreshold       uint64
	HasInlineSizeThreshold    bool
	DedicatedSizeThreshold    uint64
	HasDedicatedSizeThreshold bool
}

BlobFieldOptions selects native blob storage thresholds. A nil threshold leaves the native default in place; a present zero inline threshold is valid, while a present zero dedicated threshold is rejected natively.

type BlobFile

type BlobFile struct {
	// contains filtered or unexported fields
}

BlobFile is a native blob handle. It is independent of the dataset that produced it and owns the state needed to read the blob after dataset close. Callers serialize access through the public BlobFile.

func (*BlobFile) Close

func (f *BlobFile) Close()

Close frees the native handle allocation. It does not perform a native close; the public wrapper only calls it after no operation is in flight.

func (*BlobFile) ReadRange

func (f *BlobFile) ReadRange(offset uint64, dst []byte) error

ReadRange reads exactly len(dst) bytes at offset without moving the cursor.

func (*BlobFile) ReadRanges

func (f *BlobFile) ReadRanges(ranges []BlobRange, destinations [][]byte) error

ReadRanges reads several ranges without moving the cursor. The native call validates the complete request before writing any destination.

func (*BlobFile) ReadUpTo

func (f *BlobFile) ReadUpTo(dst []byte) (uint64, error)

ReadUpTo reads at most len(dst) bytes from the cursor and returns the number of bytes read. A read at or past the end returns zero without an error.

func (*BlobFile) Seek

func (f *BlobFile) Seek(pos uint64) error

Seek moves the cursor to pos. Positions past the end are allowed.

func (*BlobFile) SetBufferSize

func (f *BlobFile) SetBufferSize(size uint64) error

SetBufferSize sets the native read-ahead buffer size. Zero disables read-ahead; the setting never changes the visible bytes or cursor.

func (*BlobFile) Size

func (f *BlobFile) Size() (uint64, error)

Size returns the blob length. A zero size is a valid empty blob; a native error is returned separately.

func (*BlobFile) Tell

func (f *BlobFile) Tell() (uint64, error)

Tell returns the cursor position.

type BlobRange

type BlobRange struct {
	Offset uint64
	Length uint64
}

BlobRange is a byte range within one blob.

type BlobRangeRequest

type BlobRangeRequest struct {
	Row    uint64
	Offset uint64
	Length uint64
}

BlobRangeRequest asks for a byte range from one row selected by a blob read.

type BlobReadOptions

type BlobReadOptions struct {
	IOBufferSize *uint64
	Order        int32
}

BlobReadOptions mirrors LanceBlobReadOptions. A nil pointer selects native defaults; an explicit zero IOBufferSize is forwarded and rejected natively.

type BranchIdentifier

type BranchIdentifier struct {
	VersionMapping []BranchVersionMapping
}

BranchIdentifier maps a branch's versions to the manifest UUIDs they were cloned from.

func (*BranchIdentifier) UnmarshalJSON

func (b *BranchIdentifier) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes native camelCase-independent wire data without converting integer identifiers through float64.

type BranchInfo

type BranchInfo struct {
	Name          string
	ParentBranch  string
	ParentVersion uint64
	CreateAt      time.Time
	ManifestSize  uint64
	Metadata      map[string]string
	Identifier    BranchIdentifier
}

BranchInfo is a copied snapshot of one named branch.

type BranchOptions

type BranchOptions struct {
	StorageOptions map[string]string
}

BranchOptions selects branch creation behavior.

A nil *BranchOptions inherits the source dataset's store parameters. A non-nil value, including one with an empty StorageOptions map, passes explicit storage options to native branch creation.

type BranchVersionMapping

type BranchVersionMapping struct {
	Version uint64
	UUID    string
}

BranchVersionMapping records one version-to-manifest mapping in a branch identifier. UUID is empty when the native manifest reference has no UUID.

type CacheSpec

type CacheSpec struct {
	Kind        CacheSpecKind
	SizeBytes   uint64
	URI         string
	BackendKind string
	Options     map[string]string
}

CacheSpec describes one session cache. Only the field group selected by Kind is passed to native code.

type CacheSpecKind

type CacheSpecKind int32

CacheSpecKind selects one field group in a native session cache spec.

const (
	CacheSpecDefault CacheSpecKind = 0
	CacheSpecSize    CacheSpecKind = 1
	CacheSpecURI     CacheSpecKind = 2
	CacheSpecConfig  CacheSpecKind = 3
)

type CacheStats

type CacheStats struct {
	IndexCacheHits         uint64
	IndexCacheMisses       uint64
	IndexCacheEntries      uint64
	IndexCacheSizeBytes    uint64
	MetadataCacheHits      uint64
	MetadataCacheMisses    uint64
	MetadataCacheEntries   uint64
	MetadataCacheSizeBytes uint64
}

CacheStats is a snapshot of both native session caches.

type CallResult

type CallResult struct {
	JSON  []byte
	Bytes []byte
}

CallResult holds the two independent result channels of a namespace call. Both fields are copied out of native memory before the result is closed.

type Code

type Code int32

Code mirrors LanceErrorCode from include/lance/lance.h.

const (
	CodeOK                   Code = 0
	CodeInvalidArgument      Code = 1
	CodeIO                   Code = 2
	CodeNotFound             Code = 3
	CodeDatasetAlreadyExists Code = 4
	CodeIndex                Code = 5
	CodeInternal             Code = 6
	CodeNotSupported         Code = 7
	CodeCommitConflict       Code = 8
	CodePanic                Code = 9
)

Error codes defined by the pinned lance-c header.

func (Code) String

func (c Code) String() string

String returns the C enumerator name, or LanceErrorCode(N) for codes added by a newer lance-c.

type ColumnAlteration

type ColumnAlteration struct {
	Path         string
	Rename       *string
	NullableMode int32
	DataType     arrow.DataType
}

ColumnAlteration is one native alter_columns entry. Rename nil keeps the name; NullableMode uses the native sentinel values; DataType nil keeps the type. At least one of them must change.

type ColumnOrdering

type ColumnOrdering struct {
	Column    string
	Direction int32
	NullOrder int32
}

ColumnOrdering is one native order-by key.

type ColumnUpdate

type ColumnUpdate struct {
	Column string
	Value  string
}

ColumnUpdate assigns Value, a SQL scalar expression, to Column.

type CommitLock

type CommitLock struct {
	// contains filtered or unexported fields
}

CommitLock is an owned native commit-lock handle. Native datasets, transactions and scanners retain their own native owner after Close, so the lock may be closed while those objects remain usable.

func NewCommitLock

func NewCommitLock(callbacks CommitLockCallbacks) (*CommitLock, error)

NewCommitLock constructs a native commit lock. The callback context is transferred to native code only on success. Construction failure drops the Go context without invoking release_context.

func (*CommitLock) Close

func (l *CommitLock) Close()

Close drops this handle's native owner. It is idempotent; native objects that already retained the lock keep their own owner.

func (*CommitLock) Handle

func (l *CommitLock) Handle() uintptr

Handle returns the native commit-lock pointer, or zero after Close.

type CommitLockCallbacks

type CommitLockCallbacks struct {
	Acquire func(version uint64) (any, error)
	Release func(lease any, success bool) error
	Destroy func(lease any)
}

CommitLockCallbacks implements the native commit-lock contract. Acquire and Release run synchronously on native threads and may be invoked concurrently. Acquire owns the returned lease value even when it also returns an error; native code destroys such a partial lease exactly once without releasing it. Release may be called more than once for the same lease and must be idempotent. Destroy runs exactly once for every returned lease, including nil for a stateless lease; when nil it only drops internal lease tracking.

type CommitOptions

type CommitOptions struct {
	UseStableRowIDs       *bool
	EnableV2ManifestPaths *bool
	MaxRetries            *uint32
	RetryTimeout          *time.Duration
	Timeout               CommitTimeout
	Detached              bool
	SkipAutoCleanup       bool
	DataStorageVersion    *string
	StorageOptions        map[string]string
	Session               *Session
}

CommitOptions controls native transaction publication.

type CommitTimeout

type CommitTimeout struct {
	Mode     CommitTimeoutMode
	Duration time.Duration
}

CommitTimeout selects the native overall commit timeout.

type CommitTimeoutMode

type CommitTimeoutMode int32

CommitTimeoutMode mirrors LanceCommitTimeoutMode.

const (
	CommitTimeoutDefault  CommitTimeoutMode = 0
	CommitTimeoutDisabled CommitTimeoutMode = 1
	CommitTimeoutExplicit CommitTimeoutMode = 2
)

type CompactionPlan

type CompactionPlan struct {
	// contains filtered or unexported fields
}

CompactionPlan is an opaque native LanceCompactionPlan handle.

func CompactionPlanFromJSON

func CompactionPlanFromJSON(data string) (*CompactionPlan, error)

CompactionPlanFromJSON restores a native plan from serialized JSON.

func (*CompactionPlan) Close

func (p *CompactionPlan) Close()

Close releases the native plan handle. It is not safe for concurrent use.

func (*CompactionPlan) JSON

func (p *CompactionPlan) JSON() (string, error)

JSON returns the plan's native serialized JSON.

func (*CompactionPlan) ReadVersion

func (p *CompactionPlan) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the plan was created from.

func (*CompactionPlan) TaskAt

func (p *CompactionPlan) TaskAt(index uint64) (*CompactionTask, error)

TaskAt returns an owned snapshot of one plan task.

func (*CompactionPlan) TaskCount

func (p *CompactionPlan) TaskCount() (uint64, error)

TaskCount returns the number of tasks in the plan.

type CompactionTask

type CompactionTask struct {
	// contains filtered or unexported fields
}

CompactionTask is an opaque native LanceCompactionTask handle.

func CompactionTaskFromJSON

func CompactionTaskFromJSON(data string) (*CompactionTask, error)

CompactionTaskFromJSON restores a native task from serialized JSON.

func (*CompactionTask) Close

func (t *CompactionTask) Close()

Close releases the native task handle. It is not safe for concurrent use.

func (*CompactionTask) Execute

func (t *CompactionTask) Execute(dataset *Dataset) (*RewriteResult, error)

Execute executes the task against dataset at the task's read version.

func (*CompactionTask) FragmentCount

func (t *CompactionTask) FragmentCount() (uint64, error)

FragmentCount returns the number of source fragments in the task.

func (*CompactionTask) FragmentMetadataJSONAt

func (t *CompactionTask) FragmentMetadataJSONAt(index uint64) (string, error)

FragmentMetadataJSONAt returns one source fragment's metadata JSON.

func (*CompactionTask) JSON

func (t *CompactionTask) JSON() (string, error)

JSON returns the task's native serialized JSON.

func (*CompactionTask) ReadVersion

func (t *CompactionTask) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the task must read.

type ContextProvider

type ContextProvider interface {
	ProvideContext(operation, objectID string) (map[string]string, error)
}

ContextProvider supplies dynamic request context for a namespace. The operation name and object identifier are native OperationInfo values and must not be retained: the callback copies them only for the call. Returning an error or panicking is logged by native code and treated as an empty context; the request continues.

type CustomNamespaceDispatcher

type CustomNamespaceDispatcher interface {
	DispatchNamespace(operation string, requestJSON []byte) ([]byte, error)
}

CustomNamespaceDispatcher implements the single native dispatch callback used by a custom namespace. The operation string identifies which typed request model requestJSON contains. The returned JSON must be a response model for that operation.

type DataFile

type DataFile struct {
	// contains filtered or unexported fields
}

DataFile is an owned snapshot of native Lance DataFile metadata. It remains valid after the dataset, fragment or operation that produced it is closed.

func (*DataFile) BaseID

func (f *DataFile) BaseID() (uint32, bool, error)

BaseID returns the optional native base ID.

func (*DataFile) Clone

func (f *DataFile) Clone() (*DataFile, error)

Clone returns an independently owned metadata snapshot.

func (*DataFile) Close

func (f *DataFile) Close()

Close releases the data-file handle. It is idempotent.

func (*DataFile) ColumnIndexAt

func (f *DataFile) ColumnIndexAt(index uint64) (int32, error)

ColumnIndexAt returns one native column index, including the native -1 marker.

func (*DataFile) ColumnIndexCount

func (f *DataFile) ColumnIndexCount() (uint64, error)

ColumnIndexCount returns the number of native column indices.

func (*DataFile) FieldIDAt

func (f *DataFile) FieldIDAt(index uint64) (int32, error)

FieldIDAt returns one native field ID.

func (*DataFile) FieldIDCount

func (f *DataFile) FieldIDCount() (uint64, error)

FieldIDCount returns the number of native field IDs.

func (*DataFile) FileSize

func (f *DataFile) FileSize() (uint64, bool, error)

FileSize returns the optional native data-file size.

func (*DataFile) FileVersion

func (f *DataFile) FileVersion() (uint32, uint32, error)

FileVersion returns the native data-file format version.

func (*DataFile) Path

func (f *DataFile) Path() (string, error)

Path returns the native data-file path.

type DataReplacementGroup

type DataReplacementGroup struct {
	// contains filtered or unexported fields
}

DataReplacementGroup is an owned native data replacement group.

func NewDataReplacementGroup

func NewDataReplacementGroup(fragmentID uint64, newFile *DataFile) (*DataReplacementGroup, error)

NewDataReplacementGroup clones newFile into a new group.

func (*DataReplacementGroup) Clone

Clone returns an independent snapshot.

func (*DataReplacementGroup) Close

func (g *DataReplacementGroup) Close()

Close releases the group handle. It is idempotent.

func (*DataReplacementGroup) File

func (g *DataReplacementGroup) File() (*DataFile, error)

File clones the group's data file.

func (*DataReplacementGroup) FragmentID

func (g *DataReplacementGroup) FragmentID() (uint64, error)

FragmentID returns the native fragment ID. Zero is valid.

type Dataset

type Dataset struct {
	// contains filtered or unexported fields
}

Dataset is an opaque native LanceDataset handle.

A Dataset owns one native handle. Close releases it and is idempotent, so only the first call reaches native code even when several goroutines call Close.

func Commit

func Commit(uri string, tx *Transaction, opts CommitOptions) (*Dataset, error)

Commit publishes one transaction through CommitBuilder::execute.

func CommitWithAccessor

func CommitWithAccessor(uri string, tx *Transaction, opts CommitOptions, accessor *StorageOptionsAccessor) (*Dataset, error)

CommitWithAccessor publishes one transaction using a reusable storage options accessor. The returned dataset retains the accessor for later I/O; the transaction metadata does not.

func CommitWithAccessorAndCommitLock

func CommitWithAccessorAndCommitLock(uri string, tx *Transaction, opts CommitOptions, accessor *StorageOptionsAccessor, lock *CommitLock) (*Dataset, error)

CommitWithAccessorAndCommitLock publishes one transaction through an external commit lock. The accessor may be nil; static storage options are not accepted on this path. The returned dataset retains both native owners.

func OpenDataset

func OpenDataset(uri string, version uint64) (*Dataset, error)

OpenDataset opens the dataset at uri. A zero version selects the latest version. This compatibility wrapper uses no storage options or session.

func OpenDatasetWithOptions

func OpenDatasetWithOptions(uri string, opts OpenOptions) (*Dataset, error)

OpenDatasetWithOptions opens a dataset with storage options, optional per-base store parameters, a version and an optional shared session.

func Write

func Write(uri string, reader array.RecordReader, opts WriteOptions, storageOptions map[string]string) (*Dataset, error)

Write writes reader to uri. The stream is consumed by native code on every return path after export. The caller keeps ownership of reader, but must not use it after this call unless it retained an independent reference before.

func WriteWithAccessor

func WriteWithAccessor(uri string, reader array.RecordReader, opts WriteOptions, accessor *StorageOptionsAccessor) (*Dataset, error)

WriteWithAccessor writes reader using a reusable storage-options accessor. The accessor is mutually exclusive with static storage options and is retained by the returned dataset for later I/O.

func WriteWithAccessorAndCommitLock

func WriteWithAccessorAndCommitLock(uri string, reader array.RecordReader, opts WriteOptions, accessor *StorageOptionsAccessor, session *Session, lock *CommitLock) (*Dataset, error)

WriteWithAccessorAndCommitLock writes reader through an external commit lock. The accessor and session may be nil. Native retains both owners in the returned dataset.

func WriteWithNativeOptions

func WriteWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, options *NativeWriteOptions) (*Dataset, error)

WriteWithNativeOptions writes reader using an owned native options handle.

func (*Dataset) AddBases

func (d *Dataset) AddBases(bases []BasePath, properties map[string]string) error

AddBases registers bases on this handle and commits one native version.

The native transaction copies the inputs before committing; ID allocation and conflict validation stay in Lance core. A nil properties map passes native None, while a non-nil map, including an empty one, passes an explicitly present property map.

func (*Dataset) AddColumnsBatchUDF

func (d *Dataset) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) error

AddColumnsBatchUDF computes one or more new columns through a Go mapper. readColumnsSet distinguishes the C NULL read-columns option from an empty list. batchSize nil likewise means the option is absent; a non-nil value is forwarded verbatim, including zero.

func (*Dataset) AddColumnsNulls

func (d *Dataset) AddColumnsNulls(schema *arrow.Schema) error

func (*Dataset) AddColumnsSQL

func (d *Dataset) AddColumnsSQL(columns []SQLColumn, batchSize uint64) error

func (*Dataset) AddColumnsStream

func (d *Dataset) AddColumnsStream(reader array.RecordReader, batchSize uint64) error

func (*Dataset) AlterColumns

func (d *Dataset) AlterColumns(alterations []ColumnAlteration) error

func (*Dataset) BasePaths

func (d *Dataset) BasePaths() (map[uint32]BasePath, error)

BasePaths returns the current snapshot's base-path registry keyed by native base ID. The map and its values are independent copies of the snapshot.

func (*Dataset) Branch

func (d *Dataset) Branch(name string) (BranchInfo, error)

Branch fetches one branch by name.

func (*Dataset) Branches

func (d *Dataset) Branches() ([]BranchInfo, error)

Branches snapshots all branches. The result is ordered by name.

func (*Dataset) CheckoutBranch

func (d *Dataset) CheckoutBranch(branch string) (*Dataset, error)

CheckoutBranch returns an independent dataset at the latest branch version.

func (*Dataset) CheckoutRef

func (d *Dataset) CheckoutRef(ref Ref) (*Dataset, error)

CheckoutRef returns an independent dataset checked out at ref.

func (*Dataset) Cleanup

Cleanup runs native cleanup with an explicit policy.

func (*Dataset) CleanupExplain

CleanupExplain reports cleanup candidates for the current dataset state.

func (*Dataset) CleanupOldVersions

func (d *Dataset) CleanupOldVersions(options compaction.CleanupOldVersionsOptions) (compaction.RemovalStats, error)

CleanupOldVersions removes versions older than the requested duration.

Cleanup is destructive storage maintenance. It does not take a snapshot lease and cannot roll back successful deletions if a later deletion fails. Snapshot handles do not protect removed files.

func (*Dataset) Clone

func (d *Dataset) Clone() (*Dataset, error)

Clone returns an independent handle to the same native snapshot as d.

The clone shares the underlying Arc<Dataset> but has its own lock, so mutating or closing either handle does not change the other handle's snapshot. Cloning is an in-memory operation: it performs no storage I/O and does not reopen the dataset by URI.

func (*Dataset) Close

func (d *Dataset) Close()

Close releases the native dataset handle. It is idempotent.

func (*Dataset) CommitCompaction

func (d *Dataset) CommitCompaction(results []*RewriteResult, options *compaction.Options) (compaction.Metrics, error)

CommitCompaction commits rewrite results to a dataset.

func (*Dataset) CommitIndexSegments

func (d *Dataset) CommitIndexSegments(indexName, column string, segments [][]byte) error

CommitIndexSegments commits encoded segment metadata to the open dataset in one version. The native call mutates the handle in place.

func (*Dataset) CommitOptimizeIndices

func (d *Dataset) CommitOptimizeIndices(results []*IndexSegmentResult, options *compaction.OptimizeOptions) error

CommitOptimizeIndices commits merged index results to a dataset.

func (*Dataset) CompactFiles

func (d *Dataset) CompactFiles(options *compaction.Options) (compaction.Metrics, error)

CompactFiles runs native CompactionOptionsV2 compaction in place on d.

func (*Dataset) Config

func (d *Dataset) Config() (map[string]string, error)

Config returns a stable copy of the dataset configuration snapshot. The native snapshot is valid independently of the dataset handle, but this method still copies every key and value before closing it.

func (*Dataset) CountRows

func (d *Dataset) CountRows() (uint64, error)

CountRows returns the dataset row count from the manifest.

func (*Dataset) CountRowsFiltered

func (d *Dataset) CountRowsFiltered(filter string) (uint64, error)

CountRowsFiltered returns the row count matching a native SQL filter.

func (*Dataset) CreateBranch

func (d *Dataset) CreateBranch(name string, ref Ref, options *BranchOptions) (*Dataset, error)

CreateBranch shallow-clones ref into a new branch and returns its dataset.

func (*Dataset) CreateDataFile

func (d *Dataset) CreateDataFile(path string, baseID *uint32) (*DataFile, error)

CreateDataFile creates native data-file metadata from an existing Lance file.

func (*Dataset) CreateScalarIndex

func (d *Dataset) CreateScalarIndex(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, replace bool) error

CreateScalarIndex creates a scalar index. Empty params forwards NULL so the native plugin supplies defaults; non-empty params are forwarded verbatim.

func (*Dataset) CreateScalarIndexWithOptionsAndProgress

func (d *Dataset) CreateScalarIndexWithOptionsAndProgress(column, name string, indexType int32, params []byte, opts *ScalarIndexOptions, progress func(ProgressObservation), replace bool) error

CreateScalarIndexWithOptionsAndProgress creates a scalar index with additive train controls and a progress observer.

func (*Dataset) CreateScalarIndexWithProgress

func (d *Dataset) CreateScalarIndexWithProgress(column, name string, indexType int32, params []byte, progress func(ProgressObservation), replace bool) error

CreateScalarIndexWithProgress creates a scalar index through the legacy entry point with a progress observer.

func (*Dataset) CreateTag

func (d *Dataset) CreateTag(name string, ref Ref) error

CreateTag creates a tag targeting ref.

func (*Dataset) CreateVectorIndex

func (d *Dataset) CreateVectorIndex(column, name string, opts *VectorIndexOptions, replace bool) error

CreateVectorIndex creates a vector index on the open dataset handle.

func (*Dataset) CreateVectorIndexWithOptionsAndProgress

func (d *Dataset) CreateVectorIndexWithOptionsAndProgress(column, name string, opts *VectorIndexOptions, progress func(ProgressObservation), replace bool) error

CreateVectorIndexWithOptionsAndProgress creates a vector index from additive options with a progress observer.

func (*Dataset) CurrentBranchIdentifier

func (d *Dataset) CurrentBranchIdentifier() (BranchIdentifier, error)

CurrentBranchIdentifier reports the receiver's branch lineage.

func (*Dataset) CurrentVersion

func (d *Dataset) CurrentVersion() (VersionInfo, error)

CurrentVersion reports the version checked out by this handle.

func (*Dataset) DataStatistics

func (d *Dataset) DataStatistics() ([]FieldStatistics, error)

DataStatistics computes per-field compressed on-disk statistics.

func (*Dataset) Delete

func (d *Dataset) Delete(predicate string) (uint64, error)

Delete removes rows matching predicate from this handle.

func (*Dataset) DeleteBranch

func (d *Dataset) DeleteBranch(name string) error

DeleteBranch removes a branch using native reference-protection rules.

func (*Dataset) DeleteTag

func (d *Dataset) DeleteTag(name string) error

DeleteTag removes one tag.

func (*Dataset) DescribeIndicesJSON

func (d *Dataset) DescribeIndicesJSON() ([]byte, error)

DescribeIndicesJSON returns the native index description JSON.

func (*Dataset) DropColumns

func (d *Dataset) DropColumns(columns []string) error

func (*Dataset) DropIndex

func (d *Dataset) DropIndex(name string) error

DropIndex drops a user index by name.

func (*Dataset) FieldIDAt

func (d *Dataset) FieldIDAt(index uint64) (int32, error)

func (*Dataset) FieldIDCount

func (d *Dataset) FieldIDCount() (uint64, error)

func (*Dataset) ForceDeleteBranch

func (d *Dataset) ForceDeleteBranch(name string) error

ForceDeleteBranch removes a branch even when its BranchContents is missing.

func (*Dataset) FragmentCount

func (d *Dataset) FragmentCount() (uint64, error)

FragmentCount returns the number of fragments in the dataset snapshot.

func (*Dataset) FragmentIDs

func (d *Dataset) FragmentIDs() ([]uint64, error)

FragmentIDs returns the fragment IDs in manifest order.

func (*Dataset) IndexCount

func (d *Dataset) IndexCount() (uint64, error)

IndexCount returns the number of user indexes in the snapshot.

func (*Dataset) IndexListJSON

func (d *Dataset) IndexListJSON() ([]byte, error)

IndexListJSON returns the native user index list JSON.

func (*Dataset) IndexSegmentCount

func (d *Dataset) IndexSegmentCount(name string) (uint64, error)

IndexSegmentCount returns the number of physical segments for index name.

func (*Dataset) IndexSegments

func (d *Dataset) IndexSegments(name string) ([]byte, error)

IndexSegments returns the raw 16-byte UUIDs of index name's segments.

func (*Dataset) IndexSegmentsJSON

func (d *Dataset) IndexSegmentsJSON() ([]byte, error)

IndexSegmentsJSON returns the native physical segment list JSON.

func (*Dataset) IndexStatisticsJSON

func (d *Dataset) IndexStatisticsJSON(name string) ([]byte, error)

IndexStatisticsJSON returns the native family-specific statistics JSON.

func (*Dataset) LatestVersion

func (d *Dataset) LatestVersion() (uint64, error)

LatestVersion returns the latest committed dataset version.

func (*Dataset) Merge

func (d *Dataset) Merge(leftOn, rightOn string, source array.RecordReader) error

Merge left-joins columns from source into this handle. The source stream is consumed by the native call on every return path after export.

func (*Dataset) MergeIndexMetadata

func (d *Dataset) MergeIndexMetadata(uuid [16]byte, indexType string, batchReadhead *uint64, progress func(ProgressObservation)) error

MergeIndexMetadata writes or merges the root artifact of one index. It does not commit a dataset version; publication requires a separate index creation.

func (*Dataset) MergeIndexSegments

func (d *Dataset) MergeIndexSegments(segments [][]byte) ([]byte, error)

MergeIndexSegments merges encoded uncommitted segment metadata without committing it. An empty set is forwarded so native validation decides.

func (*Dataset) MergeInsert

func (d *Dataset) MergeInsert(onColumns []string, source array.RecordReader, params MergeInsertParams) (MergeInsertResult, error)

MergeInsert merges source into this handle on the given keys. The source stream is consumed by the native call on every return path after export.

func (*Dataset) MetadataJSON

func (d *Dataset) MetadataJSON() (string, error)

func (*Dataset) NativeSchema

func (d *Dataset) NativeSchema() (*Schema, error)

NativeSchema clones the dataset's native logical schema.

func (*Dataset) NewScalarSegmentBuilder

func (d *Dataset) NewScalarSegmentBuilder(column, name string, indexType int32, params []byte, options *ScalarIndexOptions, selection SegmentSelection) (*SegmentBuilder, error)

NewScalarSegmentBuilder creates a scalar segment builder. A non-nil options value forwards its train flag; params is the plugin-specific JSON options blob, with nil meaning the native default.

func (*Dataset) NewVectorSegmentBuilder

func (d *Dataset) NewVectorSegmentBuilder(column, name string, options *VectorIndexOptions, selection SegmentSelection) (*SegmentBuilder, error)

NewVectorSegmentBuilder creates a vector segment builder. The builder takes its own dataset snapshot, so the dataset handle does not need to outlive it.

func (*Dataset) OpenFragment

func (d *Dataset) OpenFragment(id uint64) (*Fragment, error)

OpenFragment resolves a bound fragment snapshot by ID.

func (*Dataset) OptimizeIndices

func (d *Dataset) OptimizeIndices(options *compaction.OptimizeOptions) error

OptimizeIndices runs native single-process index optimization in place on d.

func (*Dataset) PlanCompaction

func (d *Dataset) PlanCompaction(options *compaction.Options) (*CompactionPlan, error)

PlanCompaction creates a native compaction plan from a dataset snapshot.

func (*Dataset) PlanOptimizeIndices

func (d *Dataset) PlanOptimizeIndices(options *compaction.OptimizeOptions) (*OptimizeIndicesPlan, error)

PlanOptimizeIndices creates a native index-optimization plan from a dataset snapshot.

func (*Dataset) PrepareFTSMatchQuery

func (d *Dataset) PrepareFTSMatchQuery(column, query string, matchOperator int32, maxFuzzyDistance uint32, coverage int32) (*FTSQueryContext, error)

PrepareFTSMatchQuery prepares a Match query context pinned to d's snapshot.

func (*Dataset) PrepareFTSPhraseQuery

func (d *Dataset) PrepareFTSPhraseQuery(column, query string, slop int32, coverage int32) (*FTSQueryContext, error)

PrepareFTSPhraseQuery prepares a Phrase query context pinned to d's snapshot.

func (*Dataset) PrewarmIndex

func (d *Dataset) PrewarmIndex(name string, opts *PrewarmOptions) error

PrewarmIndex warms index segments. A nil opts value uses the legacy all-segment call.

func (*Dataset) ReadBlobRanges

func (d *Dataset) ReadBlobRanges(column string, selector int32, requests []BlobRangeRequest, options *BlobReadOptions) (*StreamReader, error)

ReadBlobRanges plans a blob-range read and returns a stream reader. The caller owns the reader and must release it.

func (*Dataset) ReadBlobs

func (d *Dataset) ReadBlobs(column string, selector int32, rows []uint64, options *BlobReadOptions) (*StreamReader, error)

ReadBlobs plans a whole-blob read and returns a stream reader. The caller owns the reader and must release it.

func (*Dataset) ReadTransaction

func (d *Dataset) ReadTransaction() (*Transaction, error)

ReadTransaction reads the current snapshot's transaction. It returns (nil, nil) when the manifest has no transaction file.

func (*Dataset) ReadTransactionByVersion

func (d *Dataset) ReadTransactionByVersion(version uint64) (*Transaction, error)

ReadTransactionByVersion reads a specific version's transaction.

func (*Dataset) ReplaceBranchMetadata

func (d *Dataset) ReplaceBranchMetadata(name string, metadata map[string]string) error

ReplaceBranchMetadata replaces all metadata on an existing branch.

func (*Dataset) ReplaceTagMetadata

func (d *Dataset) ReplaceTagMetadata(name string, metadata map[string]string) error

ReplaceTagMetadata replaces all metadata on an existing tag.

func (*Dataset) ResolveFieldID

func (d *Dataset) ResolveFieldID(ref FieldReference) (int32, error)

func (*Dataset) Restore

func (d *Dataset) Restore(version uint64) (*Dataset, error)

Restore commits a new version whose content is the requested version and returns an independent dataset at that new commit.

func (*Dataset) Schema

func (d *Dataset) Schema() (schema *arrow.Schema, err error)

Schema returns the dataset schema.

func (*Dataset) Tag

func (d *Dataset) Tag(name string) (TagInfo, error)

Tag fetches one tag by name.

func (*Dataset) Tags

func (d *Dataset) Tags() ([]TagInfo, error)

Tags snapshots all tags. The result is ordered by name.

func (*Dataset) Take

func (d *Dataset) Take(indices []uint64, columns []string) ([]arrow.RecordBatch, error)

Take reads rows by zero-based offsets. The returned batches are owned by the caller and must each be released.

func (*Dataset) TakeBlobs

func (d *Dataset) TakeBlobs(rowIDs []uint64, column string) ([]*BlobFile, error)

func (*Dataset) TakeBlobsByAddresses

func (d *Dataset) TakeBlobsByAddresses(rowAddresses []uint64, column string) ([]*BlobFile, error)

func (*Dataset) TakeBlobsByIndices

func (d *Dataset) TakeBlobsByIndices(indices []uint64, column string) ([]*BlobFile, error)

func (*Dataset) TakeRows

func (d *Dataset) TakeRows(rowIDs []uint64, columns []string) ([]arrow.RecordBatch, error)

TakeRows reads rows by dataset row IDs. Missing or deleted row IDs may be omitted by native Lance. The returned batches are owned by the caller and must each be released.

func (*Dataset) TrainIVFModel

func (d *Dataset) TrainIVFModel(column string, numPartitions uint32, metric int32, fragmentIDs []uint32, options *TrainerOptions) (arrow.Array, arrow.Field, error)

TrainIVFModel exports a trained IVF centroids model. The returned array is owned by the caller and must be released.

func (*Dataset) TrainPQModel

func (d *Dataset) TrainPQModel(column string, numSubVectors, numBits uint32, metric int32, ivfCentroids arrow.Array, fragmentIDs []uint32, options *TrainerOptions) (arrow.Array, arrow.Field, error)

TrainPQModel exports a trained PQ codebook conditioned on the given IVF centroids. Both the centroids and the returned array remain caller-owned; the native trainer borrows the centroid array synchronously.

func (*Dataset) Truncate

func (d *Dataset) Truncate() error

Truncate removes every row from this handle.

func (*Dataset) URI added in v0.2.0

func (d *Dataset) URI() (string, error)

URI returns a copy of the snapshot's fully qualified native URI.

The value is stable for the lifetime of the native snapshot and is copied into Go memory before return, so it remains valid after the dataset closes.

func (*Dataset) Update

func (d *Dataset) Update(predicate string, updates []ColumnUpdate) (uint64, error)

Update applies SQL expressions to rows matching predicate. An empty predicate updates every row and is passed to C as NULL.

func (*Dataset) UpdateConfigJSON

func (d *Dataset) UpdateConfigJSON(keys []string, values []*string, mode int32) (map[string]string, error)

UpdateConfigJSON merges or replaces the complete configuration and returns the complete updated map. A nil value removes the key.

func (*Dataset) UpdateFieldMetadata

func (d *Dataset) UpdateFieldMetadata(updates []FieldMetadataUpdate) error

func (*Dataset) UpdateMetadataJSON

func (d *Dataset) UpdateMetadataJSON(keys []string, values []*string, mode int32) (string, error)

func (*Dataset) UpdateSchemaMetadataJSON

func (d *Dataset) UpdateSchemaMetadataJSON(keys []string, values []*string, mode int32) (string, error)

func (*Dataset) UpdateTag

func (d *Dataset) UpdateTag(name string, ref Ref) error

UpdateTag retargets an existing tag to ref.

func (*Dataset) Validate

func (d *Dataset) Validate() error

Validate checks the dataset for consistency.

func (*Dataset) Version

func (d *Dataset) Version() (uint64, error)

Version returns the checked-out dataset version.

func (*Dataset) VersionRefs

func (d *Dataset) VersionRefs() ([]uint64, error)

VersionRefs snapshots the lightweight manifest reference ids.

func (*Dataset) Versions

func (d *Dataset) Versions() ([]VersionInfo, error)

Versions snapshots the committed version history in ascending version order.

type DedicatedBlobWriter

type DedicatedBlobWriter struct {
	// contains filtered or unexported fields
}

DedicatedBlobWriter is an opaque native dedicated blob sidecar writer.

func (*DedicatedBlobWriter) BlobID

func (w *DedicatedBlobWriter) BlobID() uint32

BlobID returns the native blob id.

func (*DedicatedBlobWriter) Close

func (w *DedicatedBlobWriter) Close()

Close frees the native allocation. It is idempotent.

func (*DedicatedBlobWriter) FinishArray

func (w *DedicatedBlobWriter) FinishArray(fieldName string) (arrow.Field, arrow.Array, error)

FinishArray consumes the native writer and returns the prepared descriptor.

func (*DedicatedBlobWriter) Path

func (w *DedicatedBlobWriter) Path() (string, error)

Path returns the native sidecar path.

func (*DedicatedBlobWriter) Write

func (w *DedicatedBlobWriter) Write(data []byte) error

Write appends bytes to the dedicated sidecar.

type DelimitedList

type DelimitedList struct {
	CommonPrefixes []string
	Objects        []string
}

DelimitedList is a copied native list_with_delimiter result.

type Error

type Error struct {
	Code    Code
	Message string
}

Error reports a Lance error code and message.

func (*Error) Error

func (e *Error) Error() string

type FTSBoostOptions

type FTSBoostOptions struct {
	NegativeBoost *float32
}

FTSBoostOptions holds Boost query options. A nil NegativeBoost keeps the native default.

type FTSCombinedFieldsOptions

type FTSCombinedFieldsOptions struct {
	Boosts        []float32
	MatchOperator int32
}

FTSCombinedFieldsOptions holds CombinedFields query options.

type FTSMatchOptions

type FTSMatchOptions struct {
	Boost               *float32
	Fuzziness           int64
	MaxExpansions       *uint64
	MatchOperator       int32
	PrefixLength        uint32
	DocumentGranularity int32
}

FTSMatchOptions holds Match query options. Nil optional fields keep native defaults.

type FTSMultiMatchOptions

type FTSMultiMatchOptions struct {
	Boosts        []float32
	MatchOperator int32
}

FTSMultiMatchOptions holds MultiMatch query options.

type FTSPhraseOptions

type FTSPhraseOptions struct {
	Slop                uint32
	DocumentGranularity int32
}

FTSPhraseOptions holds Phrase query options.

type FTSQuery

type FTSQuery struct {
	// contains filtered or unexported fields
}

FTSQuery is an immutable native full-text query value.

func NewFTSBooleanQuery

func NewFTSBooleanQuery(occurs []int32, queries []*FTSQuery) (*FTSQuery, error)

NewFTSBooleanQuery creates an immutable Boolean query. Occurs and queries must have the same length; the native constructor accepts an empty query.

func NewFTSBoostQuery

func NewFTSBoostQuery(positive, negative *FTSQuery, opts FTSBoostOptions) (*FTSQuery, error)

NewFTSBoostQuery creates an immutable Boost query.

func NewFTSCombinedFieldsQuery

func NewFTSCombinedFieldsQuery(terms string, columns []string, opts FTSCombinedFieldsOptions) (*FTSQuery, error)

NewFTSCombinedFieldsQuery creates an immutable CombinedFields query.

func NewFTSMatchQuery

func NewFTSMatchQuery(terms string, column *string, opts FTSMatchOptions) (*FTSQuery, error)

NewFTSMatchQuery creates an immutable Match query. A nil column lets scan planning resolve the indexed columns.

func NewFTSMultiMatchQuery

func NewFTSMultiMatchQuery(terms string, columns []string, opts FTSMultiMatchOptions) (*FTSQuery, error)

NewFTSMultiMatchQuery creates an immutable MultiMatch query.

func NewFTSPhraseQuery

func NewFTSPhraseQuery(terms string, column *string, opts FTSPhraseOptions) (*FTSQuery, error)

NewFTSPhraseQuery creates an immutable Phrase query.

func (*FTSQuery) Close

func (q *FTSQuery) Close() error

Close releases the native query. It is idempotent and waits for in-flight native calls that borrowed the handle.

func (*FTSQuery) IsClosed

func (q *FTSQuery) IsClosed() bool

IsClosed reports whether the query is nil or its native handle is closed.

type FTSQueryContext

type FTSQueryContext struct {
	// contains filtered or unexported fields
}

FTSQueryContext is a prepared, process-local query context pinned to one native dataset snapshot.

func (*FTSQueryContext) Close

func (c *FTSQueryContext) Close() error

Close releases the native prepared context. It is idempotent and waits for in-flight scanner attachment.

type FieldMetadataUpdate

type FieldMetadataUpdate struct {
	Field  FieldReference
	Keys   []string
	Values []*string
	Mode   int32
}

FieldMetadataUpdate replaces or merges metadata for one field.

type FieldReference

type FieldReference struct {
	Kind    FieldReferenceKind
	FieldID int32
	Path    string
}

FieldReference identifies a field by id or by nested path.

type FieldReferenceKind

type FieldReferenceKind int32

FieldReferenceKind selects how a field reference identifies a field.

const (
	FieldReferenceID   FieldReferenceKind = 0
	FieldReferencePath FieldReferenceKind = 1
)

type FieldStatistics

type FieldStatistics struct {
	FieldID     uint32
	BytesOnDisk uint64
}

FieldStatistics reports compressed on-disk bytes for one schema field.

type FileBufferDescriptor

type FileBufferDescriptor struct {
	Position uint64
	Size     uint64
}

FileBufferDescriptor mirrors LanceBufferDescriptor.

type FileCacheMode

type FileCacheMode int32

FileCacheMode mirrors LanceFileCacheMode.

const (
	FileCacheNone    FileCacheMode = 0
	FileCacheSession FileCacheMode = 1
)

type FileColumnMetadata

type FileColumnMetadata struct {
	Buffers  []FileBufferDescriptor
	Pages    []FilePageMetadata
	Encoding FileEncodingDescriptor
}

FileColumnMetadata is a copied column descriptor.

type FileColumnStatistics

type FileColumnStatistics struct {
	NumPages  uint64
	SizeBytes uint64
}

FileColumnStatistics mirrors LanceColumnStatistics.

type FileEncodingDescriptor

type FileEncodingDescriptor struct {
	Kind           FileEncodingKind
	BufferLocation uint64
	BufferLength   uint64
	DirectBytes    []byte
}

FileEncodingDescriptor is a copied encoding descriptor. DirectBytes is copied out of the native metadata snapshot.

type FileEncodingKind

type FileEncodingKind int32

FileEncodingKind mirrors LanceFileEncodingKind.

const (
	FileEncodingAbsent   FileEncodingKind = 0
	FileEncodingNone     FileEncodingKind = 1
	FileEncodingDirect   FileEncodingKind = 2
	FileEncodingIndirect FileEncodingKind = 3
)

type FileMetadata

type FileMetadata struct {
	// contains filtered or unexported fields
}

FileMetadata is an owned native metadata snapshot.

func (*FileMetadata) Close

func (m *FileMetadata) Close()

Close releases the metadata snapshot.

func (*FileMetadata) Columns

func (m *FileMetadata) Columns() ([]FileColumnMetadata, error)

Columns copies per-column and per-page descriptors.

func (*FileMetadata) GlobalBuffers

func (m *FileMetadata) GlobalBuffers() ([]FileBufferDescriptor, error)

GlobalBuffers copies global buffer descriptors (not contents).

func (*FileMetadata) Info

func (m *FileMetadata) Info() (FileMetadataInfo, error)

Info copies scalar metadata.

func (*FileMetadata) Schema

func (m *FileMetadata) Schema() (*arrow.Schema, error)

Schema copies the file's complete Arrow schema.

type FileMetadataInfo

type FileMetadataInfo struct {
	FormatVersion          int32
	MajorVersion           uint16
	MinorVersion           uint16
	NumRows                uint64
	NumDataBytes           uint64
	NumColumnMetadataBytes uint64
	NumGlobalBufferBytes   uint64
	NumFooterBytes         uint64
	FileSizeBytes          uint64
	NumColumns             uint64
	NumPhysicalColumns     uint64
	NumGlobalBuffers       uint64
}

FileMetadataInfo mirrors LanceFileMetadataInfo.

type FilePageMetadata

type FilePageMetadata struct {
	Buffers             []FileBufferDescriptor
	NumRows             uint64
	Priority            uint64
	Encoding            FileEncodingDescriptor
	EncodingDescription string
}

FilePageMetadata is a copied page descriptor.

type FileReader

type FileReader struct {
	// contains filtered or unexported fields
}

FileReader is an opaque native raw Lance-file reader.

func OpenFileReader

func OpenFileReader(uri string, storage *StorageOptionsAccessor, options *FileReaderOptions, session *Session, scheduler *FileSchedulerConfig) (*FileReader, error)

OpenFileReader opens uri as a raw Lance file. A nil storage accessor selects native None. Scheduler nil selects native defaults.

func (*FileReader) Close

func (r *FileReader) Close()

Close releases the reader allocation. Streams already returned stay usable.

func (*FileReader) IOStats

func (r *FileReader) IOStats() (FileScanStats, error)

IOStats returns cumulative native IO counters.

func (*FileReader) Metadata

func (r *FileReader) Metadata() (*FileMetadata, error)

Metadata returns an independent metadata snapshot.

func (*FileReader) NumRows

func (r *FileReader) NumRows() (uint64, error)

NumRows returns the file row count.

func (*FileReader) ReadAll

func (r *FileReader) ReadAll(batchSize, batchReadahead uint32) (*StreamReader, error)

ReadAll streams all rows. batchSize and batchReadahead must be positive; the native C API does not supply defaults.

func (*FileReader) ReadGlobalBuffer

func (r *FileReader) ReadGlobalBuffer(index uint32) ([]byte, error)

ReadGlobalBuffer reads global buffer index. Index 0 is the serialized schema; writer-added buffers start at 1.

func (*FileReader) ReadIndices

func (r *FileReader) ReadIndices(indices []uint32, batchSize, batchReadahead uint32) (*StreamReader, error)

ReadIndices streams rows at strictly increasing, unique row indices. An empty slice reads no rows.

func (*FileReader) ReadRange

func (r *FileReader) ReadRange(offset, numRows uint64, batchSize, batchReadahead uint32) (*StreamReader, error)

ReadRange streams numRows rows starting at offset.

func (*FileReader) Statistics

func (r *FileReader) Statistics() (*FileStatistics, error)

Statistics returns an independent statistics snapshot.

type FileReaderOptions

type FileReaderOptions struct {
	Columns              []string
	CacheMode            FileCacheMode
	ReadChunkSize        *uint64
	BatchSizeBytes       *uint64
	CacheRepetitionIndex *bool
	ValidateOnDecode     *bool
	InlineScheduling     *bool
}

FileReaderOptions mirrors LanceFileReaderOptions. Pointer fields preserve the difference between an unset option and an explicit zero value. A nil Columns slice leaves projection unset; a non-nil empty slice forwards an explicit empty projection.

type FileRegistryStats

type FileRegistryStats struct {
	Hits         uint64
	Misses       uint64
	ActiveStores uint64
}

FileRegistryStats mirrors LanceObjectStoreRegistryStats.

type FileScanStats

type FileScanStats struct {
	IOPS      uint64
	Requests  uint64
	BytesRead uint64
}

FileScanStats mirrors LanceScanStats.

type FileSchedulerConfig

type FileSchedulerConfig struct {
	IOBufferSizeBytes uint64
	LiteMode          int32
}

FileSchedulerConfig mirrors LanceSchedulerConfig.

type FileSession

type FileSession struct {
	// contains filtered or unexported fields
}

FileSession is an opaque native raw Lance-file session.

func OpenFileSession

func OpenFileSession(baseURI string, storage *StorageOptionsAccessor, session *Session, scheduler *FileSchedulerConfig) (*FileSession, error)

OpenFileSession opens a session over baseURI. A nil storage accessor selects native None; a non-nil accessor must stay open for the duration of this call.

func (*FileSession) BasePath

func (s *FileSession) BasePath() (string, error)

BasePath returns the native resolved base path.

func (*FileSession) Close

func (s *FileSession) Close()

Close releases the session allocation. Readers, writers, streams, and blob writers retain their shared native resources.

func (*FileSession) Contains

func (s *FileSession) Contains(relativePath string) (bool, error)

Contains reports whether relativePath exists in the session store.

func (*FileSession) DeleteFile

func (s *FileSession) DeleteFile(relativePath string) error

DeleteFile removes relativePath.

func (*FileSession) DownloadFile

func (s *FileSession) DownloadFile(relativeRemotePath, localPath string) error

DownloadFile downloads relativeRemotePath to localPath.

func (*FileSession) List

func (s *FileSession) List(relativePath string) ([]string, error)

List returns paths relative to the session base. An empty relativePath lists the base itself, which native represents as a NULL path.

func (*FileSession) ListWithDelimiter

func (s *FileSession) ListWithDelimiter(relativePath string) (DelimitedList, error)

ListWithDelimiter lists paths and common prefixes relative to the session base. An empty relativePath lists the base itself.

func (*FileSession) OpenDedicatedBlobWriter

func (s *FileSession) OpenDedicatedBlobWriter(dataFilePath string, blobID uint32) (*DedicatedBlobWriter, error)

OpenDedicatedBlobWriter opens a dedicated blob writer relative to the session base.

func (*FileSession) OpenPackedBlobWriter

func (s *FileSession) OpenPackedBlobWriter(dataFilePath string, blobID uint32) (*PackedBlobWriter, error)

OpenPackedBlobWriter opens a packed blob writer relative to the session base.

func (*FileSession) OpenReader

func (s *FileSession) OpenReader(relativePath string, options *FileReaderOptions) (*FileReader, error)

OpenReader opens a raw file reader relative to the session base.

func (*FileSession) OpenWriter

func (s *FileSession) OpenWriter(relativePath string, schema *arrow.Schema, options *FileWriterOptions) (*FileWriter, error)

OpenWriter opens a raw file writer relative to the session base. A nil schema creates a lazy writer that adopts the first batch schema.

func (*FileSession) ReadRange

func (s *FileSession) ReadRange(relativePath string, offset, length uint64) ([]byte, error)

ReadRange reads length bytes at offset from relativePath.

func (*FileSession) RegistryStats

func (s *FileSession) RegistryStats() (FileRegistryStats, error)

RegistryStats returns a snapshot of object-store registry counters.

func (*FileSession) SchedulerStats

func (s *FileSession) SchedulerStats() (FileScanStats, error)

SchedulerStats returns a snapshot of scheduler counters.

func (*FileSession) StoreIOStats

func (s *FileSession) StoreIOStats() (FileStoreIOStats, error)

StoreIOStats returns a snapshot of object-store IO counters.

func (*FileSession) StoreInfo

func (s *FileSession) StoreInfo() (FileStoreInfo, error)

StoreInfo returns a snapshot of the resolved object store's properties.

func (*FileSession) UploadFile

func (s *FileSession) UploadFile(localPath, relativeRemotePath string) error

UploadFile uploads localPath to relativeRemotePath.

type FileStatistics

type FileStatistics struct {
	// contains filtered or unexported fields
}

FileStatistics is an owned native statistics snapshot.

func (*FileStatistics) Close

func (s *FileStatistics) Close()

Close releases the statistics snapshot.

func (*FileStatistics) Columns

func (s *FileStatistics) Columns() ([]FileColumnStatistics, error)

Columns copies per-column statistics.

type FileStoreIOStats

type FileStoreIOStats struct {
	ReadIOPS     uint64
	ReadBytes    uint64
	WriteIOPS    uint64
	WrittenBytes uint64
}

FileStoreIOStats mirrors LanceObjectStoreIoStats.

type FileStoreInfo

type FileStoreInfo struct {
	BlockSize            uint64
	MaxIOPSize           uint64
	IOParallelism        uint64
	IsLocal              bool
	IsCloud              bool
	PrefersLiteScheduler bool
}

FileStoreInfo mirrors LanceObjectStoreInfo.

type FileWriteSummary

type FileWriteSummary struct {
	NumRows   uint64
	SizeBytes uint64
}

FileWriteSummary mirrors LanceFileWriteSummary.

type FileWriter

type FileWriter struct {
	// contains filtered or unexported fields
}

FileWriter is an opaque native raw Lance-file writer.

func OpenFileWriter

func OpenFileWriter(uri string, schema *arrow.Schema, options *FileWriterOptions, storage *StorageOptionsAccessor, session *Session) (*FileWriter, error)

OpenFileWriter opens a standalone raw Lance-file writer. A nil schema creates a lazy writer that adopts the first batch schema. A nil storage accessor selects native None.

func (*FileWriter) Abort

func (w *FileWriter) Abort() error

Abort forwards the native abort call.

func (*FileWriter) AddGlobalBuffer

func (w *FileWriter) AddGlobalBuffer(data []byte) (uint32, error)

AddGlobalBuffer appends a global buffer and returns its one-based index.

func (*FileWriter) AddSchemaMetadata

func (w *FileWriter) AddSchemaMetadata(key, value string) error

AddSchemaMetadata adds one schema metadata entry.

func (*FileWriter) Close

func (w *FileWriter) Close()

Close drops the writer allocation. It is idempotent and does not imply a successful finish.

func (*FileWriter) Finish

func (w *FileWriter) Finish() (FileWriteSummary, error)

Finish finalizes the file and returns the native write summary.

func (*FileWriter) WriteBatch

func (w *FileWriter) WriteBatch(batch arrow.RecordBatch) error

WriteBatch writes one borrowed Arrow batch.

type FileWriterOptions

type FileWriterOptions struct {
	DataCacheBytes    *uint64
	MaxPageBytes      *uint64
	KeepOriginalArray *bool
	Version           string
}

FileWriterOptions mirrors LanceFileWriterOptions. Pointer fields preserve unset versus explicit zero. Version is forwarded only when non-empty.

type Fragment

type Fragment struct {
	// contains filtered or unexported fields
}

Fragment is an owned snapshot of native Lance fragment metadata. A bound fragment reads the dataset version it was opened from and remains valid after the source dataset is closed or mutated. A detached fragment supports metadata inspection and operation construction only.

func CreateFragment

func CreateFragment(uri string, fragmentID uint64, reader array.RecordReader, options FragmentCreateOptions) (*Fragment, error)

CreateFragment writes one uncommitted fragment and returns detached metadata. It does not publish a version. The stream is consumed by native code on every return path after export; reader is borrowed exactly as in Write.

func CreateFragmentFromFile

func CreateFragmentFromFile(dataset *Dataset, filename string, fragmentID uint64, physicalRows *uint64) (*Fragment, error)

CreateFragmentFromFile creates one detached fragment from a stored Lance data file. filename is relative to the dataset's data directory. physicalRows is nil to let native code infer the row count; a non-nil pointer is forwarded explicitly, including a pointer to zero.

func WriteFragments

func WriteFragments(uri string, reader array.RecordReader, options FragmentCreateOptions) ([]*Fragment, error)

WriteFragments writes zero or more uncommitted fragments. Native code owns max_rows_per_file splitting. Each returned fragment is independently owned. The stream is consumed by native code on every return path after export.

func (*Fragment) AddColumnsBatchUDF

func (f *Fragment) AddColumnsBatchUDF(udf BatchUDF, readColumns []string, readColumnsSet bool, batchSize *uint32) (*Fragment, *Schema, error)

AddColumnsBatchUDF stages columns produced by udf.

func (*Fragment) AddColumnsNulls

func (f *Fragment) AddColumnsNulls(columns *arrow.Schema) (*Fragment, *Schema, error)

AddColumnsNulls stages all-null columns described by columns.

func (*Fragment) AddColumnsSQL

func (f *Fragment) AddColumnsSQL(columns []SQLColumn, batchSize *uint32) (*Fragment, *Schema, error)

AddColumnsSQL stages SQL-computed columns on a clone of the fragment.

func (*Fragment) AddColumnsStream

func (f *Fragment) AddColumnsStream(reader array.RecordReader, batchSize *uint32) (*Fragment, *Schema, error)

AddColumnsStream stages columns read from reader. The stream retains its own reference; reader remains owned by the caller.

func (*Fragment) Close

func (f *Fragment) Close()

Close releases the fragment handle. It is idempotent.

func (*Fragment) CountRows

func (f *Fragment) CountRows(filter *string) (uint64, error)

CountRows counts fragment rows, optionally applying a native SQL filter. A nil filter selects no filter; a non-nil empty string is passed as Some("").

func (*Fragment) DataFileAt

func (f *Fragment) DataFileAt(index uint64) (*DataFile, error)

DataFileAt clones one native base data file.

func (*Fragment) DataFileCount

func (f *Fragment) DataFileCount() (uint64, error)

DataFileCount returns the number of native base data files. Overlay and deletion files are not included.

func (*Fragment) DataFileForField

func (f *Fragment) DataFileForField(fieldID int32) (*DataFile, error)

DataFileForField finds the base data file storing fieldID. It returns (nil, nil) when the field is not present in any base data file.

func (*Fragment) Delete

func (f *Fragment) Delete(predicate string) (*Fragment, error)

Delete stages a deletion on this fragment snapshot and returns the updated metadata. It returns (nil, nil) when the predicate deletes every row.

func (*Fragment) DeleteRows

func (f *Fragment) DeleteRows(offsets []uint32) (*Fragment, error)

DeleteRows stages physical offsets on a clone of the fragment. A NULL native output means the offsets deleted every physical row.

func (*Fragment) DeletedRows

func (f *Fragment) DeletedRows() (uint64, error)

DeletedRows returns the deleted-row count.

func (*Fragment) ID

func (f *Fragment) ID() uint64

ID returns the native fragment ID. Zero is valid.

func (*Fragment) IsBound

func (f *Fragment) IsBound() (bool, error)

IsBound reports whether dataset-dependent reads are available.

func (*Fragment) LogicalRows

func (f *Fragment) LogicalRows() (uint64, error)

LogicalRows returns the logical row count.

func (*Fragment) MergeColumns

func (f *Fragment) MergeColumns(reader array.RecordReader, leftOn, rightOn string) (*Fragment, *Schema, error)

MergeColumns merges reader into the fragment using leftOn/rightOn.

func (*Fragment) MetadataJSON

func (f *Fragment) MetadataJSON() ([]byte, error)

MetadataJSON returns the native Fragment JSON serialization.

func (*Fragment) NativeSchema

func (f *Fragment) NativeSchema() (*Schema, error)

NativeSchema clones the fragment's native logical schema.

func (*Fragment) PhysicalRows

func (f *Fragment) PhysicalRows() (uint64, error)

PhysicalRows returns the physical row count, including deleted rows.

func (*Fragment) Scan

func (f *Fragment) Scan(opts ScannerOptions, initialize func(*Scanner) error) (*Scanner, error)

Scan starts a scanner over the fragment's bound snapshot.

Native fragment scans do not accept initial column selection or a SQL filter; callers must use projection expressions or filter through the returned scanner's supported setters.

func (*Fragment) Schema

func (f *Fragment) Schema() (*arrow.Schema, error)

Schema exports the fragment's lossy Arrow logical schema.

func (*Fragment) String

func (f *Fragment) String() string

func (*Fragment) Take

func (f *Fragment) Take(indices []uint32, columns []string) ([]arrow.RecordBatch, error)

Take returns fragment-local logical rows by index. A nil columns slice selects the full logical schema; a non-nil empty slice requests an explicit empty projection.

func (*Fragment) UpdateColumns

func (f *Fragment) UpdateColumns(reader array.RecordReader, leftOn, rightOn string) (*UpdateColumnsResult, error)

UpdateColumns stages an update from reader using leftOn/rightOn.

func (*Fragment) WriteColumnWithVersion

func (f *Fragment) WriteColumnWithVersion(schema *Schema, reader array.RecordReader, fileVersion int32) (*DataReplacementGroup, error)

WriteColumnWithVersion stages a replacement data file with an explicit native file format version.

func (*Fragment) WriteColumns

func (f *Fragment) WriteColumns(schema *Schema, reader array.RecordReader) (*DataReplacementGroup, error)

WriteColumns stages a replacement data file for schema.

type FragmentCreateOptions

type FragmentCreateOptions struct {
	Schema         *Schema
	Mode           WriteMode
	Write          *FragmentWriteOptions
	StorageOptions map[string]string
	Session        *Session
}

FragmentCreateOptions mirrors LanceFragmentCreateOptions.

A nil Schema leaves native schema inference in place. A non-nil Schema is borrowed for the call and cloned by native code before the asynchronous write starts. A nil Session or empty StorageOptions map selects native defaults.

type FragmentOffsets

type FragmentOffsets struct {
	FragmentID uint64
	Offsets    []uint32
}

FragmentOffsets is one fragment entry for NewUpdatedFragmentOffsets.

type FragmentWriteOptions

type FragmentWriteOptions struct {
	Params          WriteParams
	AutoCleanup     *AutoCleanupParams
	SkipAutoCleanup bool
}

FragmentWriteOptions mirrors the native write-parameter portion of LanceFragmentCreateOptions. It is separate from WriteOptions because the fragment-create entry points carry the write mode in their own field.

type IndexSegmentResult

type IndexSegmentResult struct {
	// contains filtered or unexported fields
}

IndexSegmentResult is an opaque native LanceIndexSegmentResult handle.

func IndexSegmentResultFromJSON

func IndexSegmentResultFromJSON(data string) (*IndexSegmentResult, error)

IndexSegmentResultFromJSON restores a native result from serialized JSON.

func (*IndexSegmentResult) Close

func (r *IndexSegmentResult) Close()

Close releases the native result handle. It is not safe for concurrent use.

func (*IndexSegmentResult) Group

func (r *IndexSegmentResult) Group() (uint32, error)

Group returns the result's merge group.

func (*IndexSegmentResult) JSON

func (r *IndexSegmentResult) JSON() (string, error)

JSON returns the result's native serialized JSON.

func (*IndexSegmentResult) PlanID

func (r *IndexSegmentResult) PlanID() ([16]byte, error)

PlanID returns the native plan identifier for this result.

func (*IndexSegmentResult) ReadVersion

func (r *IndexSegmentResult) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the result read.

func (*IndexSegmentResult) ReplaceCount

func (r *IndexSegmentResult) ReplaceCount() (uint64, error)

ReplaceCount returns the number of index segments replaced by the result.

func (*IndexSegmentResult) ReplaceUUIDAt

func (r *IndexSegmentResult) ReplaceUUIDAt(index uint64) ([16]byte, error)

ReplaceUUIDAt returns one replaced segment's UUID.

func (*IndexSegmentResult) Segment

func (r *IndexSegmentResult) Segment() (*SegmentMetadata, error)

Segment returns an owned copy of the produced segment metadata.

type MergeInsertParams

type MergeInsertParams struct {
	WhenMatched                      int32
	WhenMatchedExpression            string
	WhenNotMatched                   int32
	WhenNotMatchedBySource           int32
	WhenNotMatchedBySourceExpression string
}

MergeInsertParams mirrors LanceMergeInsertParams. Field values are native discriminants; the root package maps its typed enums onto them.

type MergeInsertResult

type MergeInsertResult struct {
	InsertedRows uint64
	UpdatedRows  uint64
	DeletedRows  uint64
}

MergeInsertResult reports the rows affected by MergeInsert.

type Namespace

type Namespace struct {
	// contains filtered or unexported fields
}

Namespace is an opaque native namespace handle. Directory, REST and Connected namespaces all share it; the native implementation owns discovery, retries, routing and credential refresh.

func NewConnectNamespace

func NewConnectNamespace(implName string, properties map[string]string, provider ContextProvider) (*Namespace, error)

NewConnectNamespace creates a native ConnectedNamespace for implName.

func NewCustomNamespace

func NewCustomNamespace(dispatcher CustomNamespaceDispatcher, namespaceID string) (*Namespace, error)

NewCustomNamespace creates a native custom namespace backed by dispatcher. The namespace ID is optional; an empty value asks native code to generate a lifetime-stable identity. Native code owns the callback context and releases it exactly once, including when this constructor fails.

func NewDirectoryNamespace

func NewDirectoryNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)

NewDirectoryNamespace creates a native DirectoryNamespace from properties. A nil or empty map uses native defaults.

func NewRestNamespace

func NewRestNamespace(properties map[string]string, provider ContextProvider) (*Namespace, error)

NewRestNamespace creates a native RestNamespace from properties.

func (*Namespace) Call

func (n *Namespace) Call(operation, requestJSON string, requestBytes []byte) (*CallResult, error)

Call executes one namespace operation. Empty requestJSON is sent as "{}". The native call is synchronous and cannot be cancelled once entered.

func (*Namespace) Close

func (n *Namespace) Close()

Close releases the native namespace. It must be called exactly once by the owner of the handle.

func (*Namespace) CommitNamespaceURI

func (n *Namespace) CommitNamespaceURI(tableIDJSON, uri string, tx *Transaction, opts CommitOptions, session *Session) (*Dataset, error)

CommitNamespaceURI commits tx to a namespace-managed publication URI.

func (*Namespace) ID

func (n *Namespace) ID() (string, error)

ID returns the native namespace identifier.

func (*Namespace) NativeHandle

func (n *Namespace) NativeHandle() uintptr

NativeHandle returns the raw native handle for the internal owner boundary.

func (*Namespace) OpenDataset

func (n *Namespace) OpenDataset(tableIDJSON string, storageOptions map[string]string, version uint64, session *Session) (*Dataset, error)

OpenDataset opens a namespace-managed table. A zero version selects the latest version. storageOptions may be nil.

func (*Namespace) OpsMetrics

func (n *Namespace) OpsMetrics() ([]byte, error)

OpsMetrics returns the native operation counters as JSON. Directory and REST namespaces provide counters; Connected namespaces return an error.

func (*Namespace) ResetOpsMetrics

func (n *Namespace) ResetOpsMetrics() error

ResetOpsMetrics resets the native operation counters.

func (*Namespace) StartRESTAdapter

func (n *Namespace) StartRESTAdapter(host string, port uint16) (*RESTAdapter, error)

StartRESTAdapter starts a native REST adapter in front of ns. host may be empty to use the native default; port zero selects an ephemeral port.

func (*Namespace) WriteDataset

func (n *Namespace) WriteDataset(tableIDJSON string, reader array.RecordReader, opts WriteOptions, storageOptions map[string]string, session *Session, branch string) (*Dataset, error)

WriteDataset writes reader through a namespace-managed destination. The stream is consumed on every return path after export.

type NamespaceError

type NamespaceError struct {
	Code    uint32
	Message string
}

NamespaceError is a failure reported through LanceNamespaceResult. Its Code is the Lance Namespace ErrorCode and is meaningful even when it is zero (Unsupported).

func (*NamespaceError) Error

func (e *NamespaceError) Error() string

type NativeWriteOptions

type NativeWriteOptions struct {
	// contains filtered or unexported fields
}

NativeWriteOptions is an owned native-backed write-options handle.

func NewNativeWriteOptions

func NewNativeWriteOptions(spec NativeWriteOptionsSpec) (*NativeWriteOptions, error)

NewNativeWriteOptions creates an owned native-backed write-options handle. On success native owns the progress callback context; on failure Go drops it without invoking the release callback.

func (*NativeWriteOptions) Close

func (o *NativeWriteOptions) Close()

Close releases the caller's native handle. Native writes clone the values they need. Close only after every call borrowing this handle has returned.

func (*NativeWriteOptions) Handle

func (o *NativeWriteOptions) Handle() uintptr

Handle returns the native handle, or zero after Close.

type NativeWriteOptionsSpec

type NativeWriteOptionsSpec struct {
	WriteOptions                  *WriteOptions
	TransactionProperties         map[string]string
	HasTransactionProperties      bool
	EnableV2ManifestPaths         *bool
	InitialBases                  []BasePath
	TargetBases                   []uint32
	TargetBaseNamesOrPaths        []string
	TargetAllBases                *bool
	BaseStoreParams               map[string]BaseStoreParams
	AllowExternalBlobOutsideBases bool
	ExternalBlobMode              int32
	BlobPackFileSizeThreshold     *uint64
	FileWriterOptions             *FileWriterOptions
	Session                       *Session
	StorageOptionsAccessor        *StorageOptionsAccessor
	CommitLock                    *CommitLock
	Progress                      *WriteProgress
}

NativeWriteOptionsSpec mirrors LanceNativeWriteOptionsSpec.

CommitLock is forwarded as NULL when nil. Namespace and fragment-create entry points still accept only the older options structure, so callers must reject native-only fields there instead of dropping them.

type NearestMode

type NearestMode int32

NearestMode identifies the shape of a nearest-query input.

const (
	// NearestSingle is one query vector of Count elements.
	NearestSingle NearestMode = 0
	// NearestBatch is Count row-major query vectors of Dimension elements.
	NearestBatch NearestMode = 1
	// NearestMultiVector is Count row-major subvectors of Dimension elements.
	NearestMultiVector NearestMode = 2
)

type NearestQuery

type NearestQuery struct {
	Column    string
	Data      unsafe.Pointer
	DataType  int32
	K         uint32
	Mode      NearestMode
	Dimension int
	Count     int
}

NearestQuery describes one raw nearest-query input. Data points to Count*Dimension elements for batch and multi-vector queries, or to Count elements for a single query. The native setter copies the data before it returns, but the caller must keep Data alive until then.

type OpenOptions

type OpenOptions struct {
	// StorageOptions are passed to lance-c as NULL-terminated key/value pairs.
	StorageOptions map[string]string
	// StorageOptionsAccessor is a reusable native accessor. It is mutually
	// exclusive with StorageOptions.
	StorageOptionsAccessor *StorageOptionsAccessor
	// BaseStoreParams binds native ObjectStoreParams to exact BasePath.path
	// keys. A nil map keeps the ordinary open path; a non-nil map, including
	// an empty one, uses the optional per-base open entry. When non-nil,
	// StorageOptions must be nil; callers bridge static options to a
	// StorageOptionsAccessor.
	BaseStoreParams map[string]BaseStoreParams
	// Version selects a dataset version. Zero selects the latest version.
	Version uint64
	// Session shares caches with other datasets. It may be nil.
	Session *Session
	// CommitLock routes commit acquisition and release through an optional
	// external lock. Static StorageOptions are not accepted on this path;
	// supply a StorageOptionsAccessor instead.
	CommitLock *CommitLock
}

OpenOptions controls dataset opening and metadata selection.

type Operation

type Operation struct {
	// contains filtered or unexported fields
}

Operation is an owned native transaction operation.

func NewAppendOperation

func NewAppendOperation(fragments []*Fragment) (*Operation, error)

NewAppendOperation clones fragments into a native Append operation.

func NewDataReplacementOperation

func NewDataReplacementOperation(groups []*DataReplacementGroup) (*Operation, error)

NewDataReplacementOperation constructs a native DataReplacement operation.

func NewDeleteOperation

func NewDeleteOperation(updated []*Fragment, deletedIDs []uint64, predicate string) (*Operation, error)

NewDeleteOperation clones updated fragments and deleted IDs into a native Delete operation.

func NewMergeOperation

func NewMergeOperation(schema *Schema, fragments []*Fragment, preservesNullability bool) (*Operation, error)

NewMergeOperation clones a complete final fragment list and complete schema.

func NewProjectOperation

func NewProjectOperation(schema *Schema, preservesNullability bool) (*Operation, error)

NewProjectOperation constructs a native Project operation from a native schema.

func NewReserveFragmentsOperation

func NewReserveFragmentsOperation(count uint32) (*Operation, error)

NewReserveFragmentsOperation constructs a native ReserveFragments operation.

func NewRestoreOperation

func NewRestoreOperation(version uint64) (*Operation, error)

NewRestoreOperation constructs a native Restore operation.

func NewUpdateBasesOperation

func NewUpdateBasesOperation(bases []BasePath) (*Operation, error)

NewUpdateBasesOperation constructs a native UpdateBases operation.

func NewUpdateOperation

func NewUpdateOperation(options UpdateOperationOptions) (*Operation, error)

NewUpdateOperation clones updated fragments and options into a native Update.

func (*Operation) AppendFragmentAt

func (o *Operation) AppendFragmentAt(index uint64) (*Fragment, error)

AppendFragmentAt clones one Append fragment as an independent detached handle.

func (*Operation) AppendFragmentCount

func (o *Operation) AppendFragmentCount() (uint64, error)

AppendFragmentCount returns the number of fragments in an Append operation.

func (*Operation) BasePathAt

func (o *Operation) BasePathAt(index uint64) (BasePath, error)

BasePathAt copies one borrowed base-path view from an UpdateBases operation.

func (*Operation) Close

func (o *Operation) Close()

Close releases the operation handle. It is idempotent.

func (*Operation) DataReplacementAt

func (o *Operation) DataReplacementAt(index uint64) (*DataReplacementGroup, error)

DataReplacementAt clones one data replacement group.

func (*Operation) DataReplacementCount

func (o *Operation) DataReplacementCount() (uint64, error)

DataReplacementCount returns the number of data replacement groups.

func (*Operation) DeleteDeletedFragmentCount

func (o *Operation) DeleteDeletedFragmentCount() (uint64, error)

DeleteDeletedFragmentCount returns the number of fully deleted fragment IDs.

func (*Operation) DeleteDeletedFragmentIDAt

func (o *Operation) DeleteDeletedFragmentIDAt(index uint64) (uint64, error)

DeleteDeletedFragmentIDAt returns one fully deleted fragment ID.

func (*Operation) DeletePredicate

func (o *Operation) DeletePredicate() (string, error)

DeletePredicate returns the Delete operation's SQL predicate.

func (*Operation) DeleteUpdatedFragmentCount

func (o *Operation) DeleteUpdatedFragmentCount() (uint64, error)

DeleteUpdatedFragmentCount returns the number of updated Delete fragments.

func (*Operation) DeleteUpdatedFragmentMetadataJSONAt

func (o *Operation) DeleteUpdatedFragmentMetadataJSONAt(index uint64) ([]byte, error)

DeleteUpdatedFragmentMetadataJSONAt serializes one updated Delete fragment.

func (*Operation) FragmentCount

func (o *Operation) FragmentCount() (uint64, error)

FragmentCount returns the fragment count for Append or Overwrite.

func (*Operation) Kind

func (o *Operation) Kind() (OperationKind, error)

Kind returns the operation variant.

func (*Operation) MergeFragmentAt

func (o *Operation) MergeFragmentAt(index uint64) (*Fragment, error)

MergeFragmentAt clones one fragment from a Merge operation.

func (*Operation) MergeFragmentCount

func (o *Operation) MergeFragmentCount() (uint64, error)

MergeFragmentCount returns the number of fragments in a Merge operation.

func (*Operation) NativeSchema

func (o *Operation) NativeSchema() (*Schema, error)

NativeSchema clones the in-memory native operation schema.

func (*Operation) PreservesNullability

func (o *Operation) PreservesNullability() (bool, error)

PreservesNullability reads the assertion from a Merge or Project operation.

func (*Operation) ReserveFragmentsCount

func (o *Operation) ReserveFragmentsCount() (uint32, error)

ReserveFragmentsCount returns the reserved fragment count.

func (*Operation) RestoreVersion

func (o *Operation) RestoreVersion() (uint64, error)

RestoreVersion returns the target version of a Restore operation.

func (*Operation) Schema

func (o *Operation) Schema() (*arrow.Schema, error)

Schema exports a lossy Arrow view of an Overwrite, Merge or Project schema.

func (*Operation) UpdateBasesCount

func (o *Operation) UpdateBasesCount() (uint64, error)

UpdateBasesCount returns the number of new base paths.

func (*Operation) UpdateFieldsModified

func (o *Operation) UpdateFieldsModified() ([]uint32, error)

UpdateFieldsModified returns the operation's modified field IDs.

func (*Operation) UpdateUpdatedFragmentAt

func (o *Operation) UpdateUpdatedFragmentAt(index uint64) (*Fragment, error)

UpdateUpdatedFragmentAt clones one updated fragment.

func (*Operation) UpdateUpdatedFragmentCount

func (o *Operation) UpdateUpdatedFragmentCount() (uint64, error)

UpdateUpdatedFragmentCount returns the number of updated fragments.

func (*Operation) UpdateUpdatedFragmentOffsets

func (o *Operation) UpdateUpdatedFragmentOffsets() (*UpdatedFragmentOffsets, bool, error)

UpdateUpdatedFragmentOffsets returns the native offset value when present.

type OperationKind

type OperationKind int32

OperationKind mirrors LanceOperationKind.

const (
	OperationUnknown           OperationKind = 0
	OperationAppend            OperationKind = 1
	OperationDelete            OperationKind = 2
	OperationOverwrite         OperationKind = 3
	OperationCreateIndex       OperationKind = 4
	OperationRewrite           OperationKind = 5
	OperationDataReplacement   OperationKind = 6
	OperationDataOverlay       OperationKind = 7
	OperationMerge             OperationKind = 8
	OperationRestore           OperationKind = 9
	OperationReserveFragments  OperationKind = 10
	OperationUpdate            OperationKind = 11
	OperationProject           OperationKind = 12
	OperationUpdateConfig      OperationKind = 13
	OperationUpdateMemWALState OperationKind = 14
	OperationClone             OperationKind = 15
	OperationUpdateBases       OperationKind = 16
)

type OptimizeIndexMerge

type OptimizeIndexMerge struct {
	// contains filtered or unexported fields
}

OptimizeIndexMerge is an opaque native LanceOptimizeIndexMerge handle.

func OptimizeIndexMergeFromJSON

func OptimizeIndexMergeFromJSON(data string) (*OptimizeIndexMerge, error)

OptimizeIndexMergeFromJSON restores a native merge from serialized JSON.

func (*OptimizeIndexMerge) Close

func (m *OptimizeIndexMerge) Close()

Close releases the native merge handle. It is not safe for concurrent use.

func (*OptimizeIndexMerge) Execute

func (m *OptimizeIndexMerge) Execute(dataset *Dataset, results []*IndexSegmentResult) (*IndexSegmentResult, error)

Execute runs the merge against a dataset snapshot and task results. A nil result means native optimization found no work for this group.

func (*OptimizeIndexMerge) Group

func (m *OptimizeIndexMerge) Group() (uint32, error)

Group returns the merge group.

func (*OptimizeIndexMerge) JSON

func (m *OptimizeIndexMerge) JSON() (string, error)

JSON returns the merge's native serialized JSON.

func (*OptimizeIndexMerge) OldSegmentAt

func (m *OptimizeIndexMerge) OldSegmentAt(index uint64) (*SegmentMetadata, error)

OldSegmentAt returns an owned copy of one old segment's metadata.

func (*OptimizeIndexMerge) OldSegmentCount

func (m *OptimizeIndexMerge) OldSegmentCount() (uint64, error)

OldSegmentCount returns the number of old segments this merge folds into its output.

func (*OptimizeIndexMerge) PlanID

func (m *OptimizeIndexMerge) PlanID() ([16]byte, error)

PlanID returns the native plan identifier for this merge.

func (*OptimizeIndexMerge) ReadVersion

func (m *OptimizeIndexMerge) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the merge reads.

func (*OptimizeIndexMerge) ReplaceCount

func (m *OptimizeIndexMerge) ReplaceCount() (uint64, error)

ReplaceCount returns the number of index segments replaced by the merge.

func (*OptimizeIndexMerge) ReplaceUUIDAt

func (m *OptimizeIndexMerge) ReplaceUUIDAt(index uint64) ([16]byte, error)

ReplaceUUIDAt returns one replaced segment's UUID.

type OptimizeIndexTask

type OptimizeIndexTask struct {
	// contains filtered or unexported fields
}

OptimizeIndexTask is an opaque native LanceOptimizeIndexTask handle.

func OptimizeIndexTaskFromJSON

func OptimizeIndexTaskFromJSON(data string) (*OptimizeIndexTask, error)

OptimizeIndexTaskFromJSON restores a native task from serialized JSON.

func (*OptimizeIndexTask) Close

func (t *OptimizeIndexTask) Close()

Close releases the native task handle. It is not safe for concurrent use.

func (*OptimizeIndexTask) EnablePartitionRebalancing

func (t *OptimizeIndexTask) EnablePartitionRebalancing() (bool, error)

EnablePartitionRebalancing reports the task's rebalancing flag.

func (*OptimizeIndexTask) Execute

func (t *OptimizeIndexTask) Execute(dataset *Dataset) (*IndexSegmentResult, error)

Execute runs the task against a dataset snapshot. A nil result means native optimization found no work for this task.

func (*OptimizeIndexTask) FragmentCount

func (t *OptimizeIndexTask) FragmentCount() (uint64, error)

FragmentCount returns the number of source fragments.

func (*OptimizeIndexTask) FragmentIDAt

func (t *OptimizeIndexTask) FragmentIDAt(index uint64) (uint32, error)

FragmentIDAt returns one source fragment id.

func (*OptimizeIndexTask) Group

func (t *OptimizeIndexTask) Group() (uint32, error)

Group returns the task's merge group.

func (*OptimizeIndexTask) JSON

func (t *OptimizeIndexTask) JSON() (string, error)

JSON returns the task's native serialized JSON.

func (*OptimizeIndexTask) NumIndicesToMerge

func (t *OptimizeIndexTask) NumIndicesToMerge() (compaction.Optional[uint64], error)

NumIndicesToMerge returns the task's optional merge limit.

func (*OptimizeIndexTask) OldSegmentAt

func (t *OptimizeIndexTask) OldSegmentAt(index uint64) (*SegmentMetadata, error)

OldSegmentAt returns an owned copy of one old segment's metadata.

func (*OptimizeIndexTask) OldSegmentCount

func (t *OptimizeIndexTask) OldSegmentCount() (uint64, error)

OldSegmentCount returns the number of old index segments the task may fold into its output.

func (*OptimizeIndexTask) PlanID

func (t *OptimizeIndexTask) PlanID() ([16]byte, error)

PlanID returns the native plan identifier for this task.

func (*OptimizeIndexTask) ReadVersion

func (t *OptimizeIndexTask) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the task reads.

func (*OptimizeIndexTask) Reference

func (t *OptimizeIndexTask) Reference() (*SegmentMetadata, error)

Reference returns an owned copy of the task's reference segment metadata.

func (*OptimizeIndexTask) Retrain

func (t *OptimizeIndexTask) Retrain() (bool, error)

Retrain reports the task's retrain flag.

type OptimizeIndicesPlan

type OptimizeIndicesPlan struct {
	// contains filtered or unexported fields
}

OptimizeIndicesPlan is an opaque native LanceOptimizeIndicesPlan handle.

func OptimizeIndicesPlanFromJSON

func OptimizeIndicesPlanFromJSON(data string) (*OptimizeIndicesPlan, error)

OptimizeIndicesPlanFromJSON restores a native plan from serialized JSON.

func (*OptimizeIndicesPlan) Close

func (p *OptimizeIndicesPlan) Close()

Close releases the native plan handle. It is not safe for concurrent use.

func (*OptimizeIndicesPlan) JSON

func (p *OptimizeIndicesPlan) JSON() (string, error)

JSON returns the plan's native serialized JSON.

func (*OptimizeIndicesPlan) MergeAt

func (p *OptimizeIndicesPlan) MergeAt(index uint64) (*OptimizeIndexMerge, error)

MergeAt returns an owned snapshot of one plan merge.

func (*OptimizeIndicesPlan) MergeCount

func (p *OptimizeIndicesPlan) MergeCount() (uint64, error)

MergeCount returns the number of merges in the plan.

func (*OptimizeIndicesPlan) PlanID

func (p *OptimizeIndicesPlan) PlanID() ([16]byte, error)

PlanID returns the native plan identifier.

func (*OptimizeIndicesPlan) ReadVersion

func (p *OptimizeIndicesPlan) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the plan was created from.

func (*OptimizeIndicesPlan) TaskAt

func (p *OptimizeIndicesPlan) TaskAt(index uint64) (*OptimizeIndexTask, error)

TaskAt returns an owned snapshot of one plan task.

func (*OptimizeIndicesPlan) TaskCount

func (p *OptimizeIndicesPlan) TaskCount() (uint64, error)

TaskCount returns the number of tasks in the plan.

type PackedBlobWriter

type PackedBlobWriter struct {
	// contains filtered or unexported fields
}

PackedBlobWriter is an opaque native packed blob sidecar writer.

func (*PackedBlobWriter) BlobID

func (w *PackedBlobWriter) BlobID() uint32

BlobID returns the native blob id.

func (*PackedBlobWriter) Close

func (w *PackedBlobWriter) Close()

Close frees the native allocation. It is idempotent.

func (*PackedBlobWriter) FinishArray

func (w *PackedBlobWriter) FinishArray(fieldName string) (arrow.Field, arrow.Array, error)

FinishArray consumes the native writer and returns the prepared descriptor.

func (*PackedBlobWriter) Path

func (w *PackedBlobWriter) Path() (string, error)

Path returns the native sidecar path.

func (*PackedBlobWriter) Write

func (w *PackedBlobWriter) Write(data []byte) error

Write appends one payload.

func (*PackedBlobWriter) WriteBlobs

func (w *PackedBlobWriter) WriteBlobs(payloads arrow.Array) error

WriteBlobs appends one borrowed Arrow array of Binary, LargeBinary, or FixedSizeBinary payloads. The Arrow bridge rejects BinaryView. Native code consumes the exported array on every return, while payloads itself remains owned by the caller.

type PinnedLibrary

type PinnedLibrary struct {
	Repository   string
	Release      string
	Commit       string
	HeaderSHA256 string
}

PinnedLibrary is the lance-c build this package was compiled against. The values are build-time metadata; lance_c_version() reports only the binding release, so a loaded library cannot be verified against them.

func Pinned

func Pinned() PinnedLibrary

Pinned returns the compile-time native pin.

type PrecomputedShuffleBuffers

type PrecomputedShuffleBuffers struct {
	Path    string
	Buffers []string
}

PrecomputedShuffleBuffers mirrors the native precomputed shuffle buffers.

type PrewarmOptions

type PrewarmOptions struct {
	WithPosition bool
	SegmentUUIDs []byte
	HasSelection bool
}

PrewarmOptions selects index segments to prewarm. SegmentUUIDs holds raw 16-byte UUIDs; HasSelection distinguishes "all" from an explicit empty selection.

type ProgressObservation

type ProgressObservation struct {
	Event     int32
	Stage     string
	Total     uint64
	Unit      string
	Completed uint64
}

ProgressObservation is one native index-build progress report. Event values and their field semantics are defined by the LanceIndexBuildProgressCallback header contract; the root package maps them to its public progress type.

type ProjectionColumn

type ProjectionColumn struct {
	OutputName string
	Expression string
}

ProjectionColumn selects an output column by SQL expression.

type RESTAdapter

type RESTAdapter struct {
	// contains filtered or unexported fields
}

RESTAdapter is an opaque native REST adapter handle.

func (*RESTAdapter) Close

func (a *RESTAdapter) Close()

Close stops the adapter when it is still serving and releases the native handle. It is safe after Shutdown and is idempotent at the owner boundary.

func (*RESTAdapter) NativeHandle

func (a *RESTAdapter) NativeHandle() uintptr

NativeHandle returns the raw native handle for the internal owner boundary.

func (*RESTAdapter) Port

func (a *RESTAdapter) Port() (uint16, error)

Port returns the bound adapter port, or zero when the adapter is stopped.

func (*RESTAdapter) Shutdown

func (a *RESTAdapter) Shutdown()

Shutdown stops serving. It is idempotent.

type Ref

type Ref struct {
	Kind    RefKind
	Version uint64
	Branch  string
	Tag     string
}

Ref is a lightweight native version reference. Build values with its constructors; the zero value is invalid.

type RefKind

type RefKind uint8

RefKind identifies the native reference variant carried by Ref.

const (
	// RefVersionNumber addresses a version number on the current branch.
	RefVersionNumber RefKind = iota + 1
	// RefBranchVersion addresses a version number on a named branch.
	RefBranchVersion
	// RefBranchLatest addresses the latest version of a named branch.
	RefBranchLatest
	// RefTag addresses the version named by a tag.
	RefTag
)

type RewriteResult

type RewriteResult struct {
	// contains filtered or unexported fields
}

RewriteResult is an opaque native LanceRewriteResult handle.

func RewriteResultFromJSON

func RewriteResultFromJSON(data string) (*RewriteResult, error)

RewriteResultFromJSON restores a native rewrite result from serialized JSON.

func (*RewriteResult) Close

func (r *RewriteResult) Close()

Close releases the native rewrite result handle. It is not safe for concurrent use.

func (*RewriteResult) JSON

func (r *RewriteResult) JSON() (string, error)

JSON returns the rewrite result's native serialized JSON.

func (*RewriteResult) Metrics

func (r *RewriteResult) Metrics() (compaction.Metrics, error)

Metrics returns the rewrite metrics.

func (*RewriteResult) NewFragmentCount

func (r *RewriteResult) NewFragmentCount() (uint64, error)

NewFragmentCount returns the number of rewritten fragments.

func (*RewriteResult) NewFragmentMetadataJSONAt

func (r *RewriteResult) NewFragmentMetadataJSONAt(index uint64) (string, error)

NewFragmentMetadataJSONAt returns one rewritten fragment's metadata JSON.

func (*RewriteResult) OriginalFragmentCount

func (r *RewriteResult) OriginalFragmentCount() (uint64, error)

OriginalFragmentCount returns the number of source fragments.

func (*RewriteResult) OriginalFragmentMetadataJSONAt

func (r *RewriteResult) OriginalFragmentMetadataJSONAt(index uint64) (string, error)

OriginalFragmentMetadataJSONAt returns one source fragment's metadata JSON.

func (*RewriteResult) ReadVersion

func (r *RewriteResult) ReadVersion() (uint64, error)

ReadVersion returns the dataset version the result read.

type RuntimeState

type RuntimeState struct {
	// Loaded reports whether a native library has been opened successfully.
	Loaded bool
	// FFIReady reports whether the mandatory C symbols are bound and native
	// calls are ready. It is false when Loaded is false.
	FFIReady bool
	// Library describes the opened library. It is the zero value when Loaded
	// is false.
	Library loader.State
	// Expected is the build-time lance-c pin.
	Expected PinnedLibrary
}

RuntimeState is a side-effect-free snapshot of the native loader and FFI binding state.

func InspectRuntime

func InspectRuntime() RuntimeState

InspectRuntime observes the loader and binding state without discovering, extracting, loading, binding, retrying, or otherwise changing it.

type SQLColumn

type SQLColumn struct {
	Name       string
	Expression string
}

SQLColumn is one add_columns_sql entry.

type ScalarIndexOptions

type ScalarIndexOptions struct {
	Train *bool
}

ScalarIndexOptions holds additive scalar index build options.

type ScanMetric

type ScanMetric struct {
	Name  string
	Kind  int32
	Value uint64
}

ScanMetric is one native scanner metric.

type ScanStatistics

type ScanStatistics struct {
	IOPS                  uint64
	Requests              uint64
	BytesRead             uint64
	IndicesLoaded         uint64
	IndexPartitionsLoaded uint64
	IndexComparisons      uint64
	Metrics               []ScanMetric
}

ScanStatistics is a snapshot of native scanner statistics.

type Scanner

type Scanner struct {
	// contains filtered or unexported fields
}

Scanner is a single-use native scan. Next may be called by one goroutine at a time; Close is safe concurrently with Next.

func NewScanner

func NewScanner(ds *Dataset, opts ScannerOptions, initialize func(*Scanner) error) (*Scanner, error)

NewScanner creates and configures a native scanner for ds. initialize attaches search configuration before the output schema is resolved. It runs synchronously during construction and must not publish the scanner.

func (*Scanner) AnalyzeCountPlan

func (s *Scanner) AnalyzeCountPlan() (string, error)

AnalyzeCountPlan returns the runtime analysis of the configured COUNT(*) plan without starting or advancing normal iteration.

func (*Scanner) AnalyzePlan

func (s *Scanner) AnalyzePlan() (string, error)

AnalyzePlan executes the configured native plan and returns its runtime analysis without starting or advancing normal iteration.

func (*Scanner) Close

func (s *Scanner) Close() error

Close releases the native scanner. It waits for an in-flight poll to leave native code before closing, then removes the Go waker and statistics handles after native close has joined callbacks.

func (*Scanner) CountRows

func (s *Scanner) CountRows() (uint64, error)

CountRows executes the configured COUNT(*) plan without starting or advancing normal iteration. A zero result is valid, so the thread-local error is always consumed.

func (*Scanner) ExplainPlan

func (s *Scanner) ExplainPlan(verbose bool) (string, error)

ExplainPlan returns the configured native plan without starting iteration.

func (*Scanner) Next

func (s *Scanner) Next(ctx context.Context) (arrow.RecordBatch, bool, error)

Next polls the scanner once, waiting without holding an OS thread when the native stream is pending. The returned batch is owned by the caller.

func (*Scanner) Schema

func (s *Scanner) Schema() *arrow.Schema

Schema returns the scanner output schema. The schema is immutable and stays valid after the scanner closes.

func (*Scanner) SetFTSIndexSegments

func (s *Scanner) SetFTSIndexSegments(uuids []byte) error

SetFTSIndexSegments restricts the scan to the given raw 16-byte UUIDs. An empty slice clears the selection.

func (*Scanner) SetFTSQuery

func (s *Scanner) SetFTSQuery(query *FTSQuery) error

SetFTSQuery attaches a typed FTS query to the scanner.

func (*Scanner) SetFTSQueryContext

func (s *Scanner) SetFTSQueryContext(ctx *FTSQueryContext) error

SetFTSQueryContext attaches a prepared FTS query context to the scanner.

func (*Scanner) SetMinHashQuery

func (s *Scanner) SetMinHashQuery(column, text string) error

SetMinHashQuery attaches a MinHash LSH query to the scanner.

func (*Scanner) Statistics

func (s *Scanner) Statistics() ScanStatistics

Statistics returns the most recent native statistics snapshot.

type ScannerOptions

type ScannerOptions struct {
	Columns              []string
	Filter               *string
	Limit                *int64
	Offset               *int64
	BatchSize            *int64
	BatchSizeBytes       *uint64
	IOBufferSize         *uint64
	BatchReadahead       *uint64
	FragmentReadahead    *uint64
	TargetParallelism    *uint64
	ScanInOrder          *bool
	UseScalarIndex       *bool
	StrictBatchSize      *bool
	UseStats             *bool
	IncludeDeletedRows   *bool
	BlobHandling         *int32
	MaterializationStyle *int32
	MaterializationEarly []string
	FragmentIDs          []uint64
	FragmentIDsSet       bool
	DisableScoring       bool
	ScalarIndexSegment   []byte
	Projection           []ProjectionColumn
	OrderBy              []ColumnOrdering
	RowID                *bool
	RowAddress           *bool
	SubstraitFilter      []byte
	SubstraitAggregate   []byte
	AdditionalSQLFilters []string
	Vector               VectorOptions
}

ScannerOptions configures a native scanner before the scan starts.

type Schema

type Schema struct {
	// contains filtered or unexported fields
}

Schema is an owned native Lance schema value. It preserves Lance field IDs, nested metadata, encodings and dictionary values that an ArrowSchema view cannot represent.

func (*Schema) Clone

func (s *Schema) Clone() (*Schema, error)

Clone returns an independently owned copy.

func (*Schema) Close

func (s *Schema) Close()

Close releases the native schema handle. It is idempotent.

func (*Schema) FieldID

func (s *Schema) FieldID(column string) (int32, error)

FieldID resolves a column path to its native Lance field ID.

func (*Schema) Project

func (s *Schema) Project(columns []string) (*Schema, error)

Project selects an ordered list of column paths without rebuilding through Arrow. A nil or empty list selects native Schema::project's empty schema.

func (*Schema) ToArrow

func (s *Schema) ToArrow() (*arrow.Schema, error)

ToArrow exports a lossy Arrow view of the native schema.

type SegmentBuilder

type SegmentBuilder struct {
	// contains filtered or unexported fields
}

SegmentBuilder owns one native uncommitted index segment builder. Builders are single-use and must be closed.

func (*SegmentBuilder) Close

func (b *SegmentBuilder) Close() error

Close releases the native builder. It is idempotent and waits for a running Execute to return.

func (*SegmentBuilder) Execute

func (b *SegmentBuilder) Execute() ([]byte, error)

Execute builds and returns the encoded IndexMetadata protobuf for one uncommitted segment. A builder can be executed at most once.

func (*SegmentBuilder) SetProgress

func (b *SegmentBuilder) SetProgress(fn func(ProgressObservation)) error

SetProgress installs or replaces the progress observer. The callback must be installed before execution; its observer remains registered until Execute returns or the builder is closed.

type SegmentMetadata

type SegmentMetadata struct {
	// contains filtered or unexported fields
}

SegmentMetadata owns one parsed native IndexMetadata protobuf. A parsed value is independent of the dataset and of the bytes it was parsed from.

func ParseSegmentMetadata

func ParseSegmentMetadata(encoded []byte) (*SegmentMetadata, error)

ParseSegmentMetadata decodes one encoded IndexMetadata protobuf.

func (*SegmentMetadata) BaseID

func (m *SegmentMetadata) BaseID() (uint32, bool, error)

BaseID returns the optional base fragment ID recorded in the metadata.

func (*SegmentMetadata) Clone

func (m *SegmentMetadata) Clone() (*SegmentMetadata, error)

Clone returns an independent copy of the metadata.

func (*SegmentMetadata) CloneWithFragmentIDs

func (m *SegmentMetadata) CloneWithFragmentIDs(fragmentIDs []uint32) (*SegmentMetadata, error)

CloneWithFragmentIDs returns an independent copy with replaced coverage. A nil slice keeps the recorded coverage; a non-nil slice, including an empty one, replaces it.

func (*SegmentMetadata) Close

func (m *SegmentMetadata) Close() error

Close releases the metadata. It is idempotent.

func (*SegmentMetadata) CoveringFieldIDs

func (m *SegmentMetadata) CoveringFieldIDs() ([]int32, error)

CoveringFieldIDs returns the fields whose data the segment covers.

func (*SegmentMetadata) CreatedAt

func (m *SegmentMetadata) CreatedAt() (int64, uint32, bool, error)

CreatedAt returns the recorded creation timestamp. The bool reports whether the optional timestamp is present.

func (*SegmentMetadata) DatasetVersion

func (m *SegmentMetadata) DatasetVersion() (uint64, error)

DatasetVersion returns the dataset version the segment was built from.

func (*SegmentMetadata) Details

func (m *SegmentMetadata) Details() ([]byte, bool, error)

Details returns the encoded index-details value. The bool reports whether the metadata carries one; a present but empty value returns a non-nil empty slice.

func (*SegmentMetadata) DetailsTypeURL

func (m *SegmentMetadata) DetailsTypeURL() (string, bool, error)

DetailsTypeURL returns the index-details type URL when the metadata records an index_details value.

func (*SegmentMetadata) Encode

func (m *SegmentMetadata) Encode() ([]byte, error)

Encode serializes the metadata back into its protobuf transport form.

func (*SegmentMetadata) FieldIDs

func (m *SegmentMetadata) FieldIDs() ([]int32, error)

FieldIDs returns the field IDs the segment indexes.

func (*SegmentMetadata) FileCount

func (m *SegmentMetadata) FileCount() (uint64, error)

FileCount returns the number of recorded index artifacts.

func (*SegmentMetadata) FilePathAt

func (m *SegmentMetadata) FilePathAt(index uint64) (string, error)

FilePathAt returns the path of one recorded index artifact.

func (*SegmentMetadata) FileSizeAt

func (m *SegmentMetadata) FileSizeAt(index uint64) (uint64, error)

FileSizeAt returns the recorded size of one index artifact.

func (*SegmentMetadata) FragmentIDs

func (m *SegmentMetadata) FragmentIDs() ([]uint32, error)

FragmentIDs returns the fragment coverage recorded in the segment.

func (*SegmentMetadata) IndexType

func (m *SegmentMetadata) IndexType() (int32, error)

IndexType returns the native index-type discriminant.

func (*SegmentMetadata) IndexVersion

func (m *SegmentMetadata) IndexVersion() (int32, error)

IndexVersion returns the native index format version of the segment.

func (*SegmentMetadata) Name

func (m *SegmentMetadata) Name() (string, error)

Name returns the segment name.

func (*SegmentMetadata) UUID

func (m *SegmentMetadata) UUID() ([16]byte, error)

UUID returns the segment UUID.

type SegmentSelection

type SegmentSelection struct {
	FragmentIDs []uint32
	UUID        *[16]byte
}

SegmentSelection selects which fragments an index segment covers and optionally fixes its identity. FragmentIDs uses the native three-way convention: nil means the whole dataset, while a non-nil empty slice means an explicit empty coverage.

type Session

type Session struct {
	// contains filtered or unexported fields
}

Session is an opaque native LanceSession handle. It owns shared index and metadata caches.

func NewSession

func NewSession(indexCacheSize, metadataCacheSize uint64) (*Session, error)

NewSession creates a session with fixed-size index and metadata caches.

func NewSessionWithCacheSpecs

func NewSessionWithCacheSpecs(indexCache, metadataCache CacheSpec) (*Session, error)

NewSessionWithCacheSpecs creates a session with independently configured index and metadata caches. Both specs are required.

func (*Session) ApproxNumItems

func (s *Session) ApproxNumItems() (uint64, error)

ApproxNumItems returns the approximate number of cached items.

func (*Session) CacheStats

func (s *Session) CacheStats() (CacheStats, error)

CacheStats returns a snapshot of the session cache counters.

func (*Session) Close

func (s *Session) Close()

Close releases the native session handle. Datasets opened with the session keep their shared cache state and remain valid.

func (*Session) NativeHandle

func (s *Session) NativeHandle() uintptr

NativeHandle returns the native session handle for internal call sites that hold an independent session lease. The caller must keep the Session open for the duration of the native call.

func (*Session) SizeBytes

func (s *Session) SizeBytes() (uint64, error)

SizeBytes returns the approximate memory size of both caches.

type StorageOptionsAccessor

type StorageOptionsAccessor struct {
	// contains filtered or unexported fields
}

StorageOptionsAccessor owns a native storage-options accessor. The accessor may contain fixed initial options, a dynamic provider, or both. Native owners retain their own references, so closing this handle does not invalidate a dataset, provider-backed store, or returned snapshot. Callers serialize Close against every native call that consumes the handle.

func NewStorageOptionsAccessor

func NewStorageOptionsAccessor(values map[string]string) (*StorageOptionsAccessor, error)

NewStorageOptionsAccessor creates an accessor with fixed options. A nil or empty map creates Some(empty), not None; use a nil accessor for native None.

func NewStorageOptionsAccessorWithPresence

func NewStorageOptionsAccessorWithPresence(initial map[string]string, hasInitial bool, provider *StorageOptionsProvider) (*StorageOptionsAccessor, error)

NewStorageOptionsAccessorWithPresence creates a native accessor. A nil initial map with hasInitial false becomes native None; a non-nil map, including an empty one, becomes native Some(initial).

func (*StorageOptionsAccessor) Close

func (a *StorageOptionsAccessor) Close()

Close releases the caller's native accessor handle. Native owners retain their own references. It is idempotent but not safe to call concurrently with Snapshot or another native use of the same handle.

func (*StorageOptionsAccessor) Handle

func (a *StorageOptionsAccessor) Handle() uintptr

Handle returns the native accessor pointer. The caller must serialize Close.

func (*StorageOptionsAccessor) Snapshot

func (a *StorageOptionsAccessor) Snapshot() (map[string]string, bool, error)

Snapshot returns the accessor's current resolved options. A nil map with hasOptions false means native None; a non-nil empty map with true means native Some(empty). Native caching, expiration and fallback are preserved.

type StorageOptionsFetchFunc

type StorageOptionsFetchFunc func(ctx context.Context, force bool) (map[string]string, error)

StorageOptionsFetchFunc resolves storage options for a native accessor. Returning a nil map means native None; a non-nil empty map means an explicitly empty option set.

type StorageOptionsProvider

type StorageOptionsProvider struct {
	// contains filtered or unexported fields
}

StorageOptionsProvider owns a native storage-options provider. The provider context is released when the final native owner (accessor, dataset, or object-store registry entry) is dropped.

func NewStorageOptionsProvider

func NewStorageOptionsProvider(id string, fetch, force StorageOptionsFetchFunc) (*StorageOptionsProvider, error)

NewStorageOptionsProvider creates a provider backed by fetch. force may be nil, in which case native force-fetch falls back to fetch. The ID is copied by native code and defines native provider equality and registry cache identity.

func NewStorageOptionsProviderFromNamespace

func NewStorageOptionsProviderFromNamespace(namespace *Namespace, tableIDJSON string) (*StorageOptionsProvider, error)

NewStorageOptionsProviderFromNamespace creates a native namespace-backed provider. The native provider retains the namespace and fetches vended credentials with typed table-id serialization.

func (*StorageOptionsProvider) Close

func (p *StorageOptionsProvider) Close()

Close releases the caller's native provider handle. Native owners retain their own references, so datasets and accessors may outlive this call.

func (*StorageOptionsProvider) ID

ID returns the provider identity copied into native code.

func (*StorageOptionsProvider) NativeID

func (p *StorageOptionsProvider) NativeID() (string, error)

NativeID reads the identity back from native code. It is primarily useful for diagnostics and tests that assert the native copy is stable.

type StreamReader

type StreamReader struct {
	// contains filtered or unexported fields
}

StreamReader incrementally drains a native ArrowArrayStream. It owns the stream and releases it exactly once. Each batch returned by Next is owned by the caller. Next and Close are serialized; batches remain valid after Close.

func NewStreamReader

func NewStreamReader(stream *cdata.ArrowArrayStream) (*StreamReader, error)

NewStreamReader takes ownership of stream and reads its schema immediately. On error the stream has already been released. On success stream.Release is cleared so the caller cannot release it a second time.

func (*StreamReader) Close

func (r *StreamReader) Close()

Close releases the native stream. It is idempotent and does not invalidate batches that were already returned.

func (*StreamReader) Next

func (r *StreamReader) Next() (arrow.RecordBatch, bool, error)

Next returns the next owned batch. A false return with a nil error marks the end of the stream. After an error every later call returns the same error.

func (*StreamReader) Schema

func (r *StreamReader) Schema() *arrow.Schema

Schema returns the immutable stream schema.

type TagInfo

type TagInfo struct {
	Name         string
	Branch       string
	Version      uint64
	CreatedAt    *time.Time
	UpdatedAt    *time.Time
	ManifestSize uint64
	Metadata     map[string]string
}

TagInfo is a copied snapshot of one named tag.

type TrainerOptions

type TrainerOptions struct {
	SampleRate *uint64
	MaxIters   *uint64
}

TrainerOptions mirrors the additive standalone trainer controls. A nil field keeps the native default.

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

Transaction is an owned native Lance transaction.

func NewTransaction

func NewTransaction(readVersion uint64, operation *Operation, opts TransactionOptions) (*Transaction, error)

NewTransaction constructs a native transaction from an operation. The operation is cloned and remains usable.

func ParseTransaction

func ParseTransaction(data []byte) (*Transaction, error)

ParseTransaction parses one complete native protobuf transaction.

func WriteUncommitted

func WriteUncommitted(uri string, reader array.RecordReader, opts WriteUncommittedOptions) (*Transaction, error)

WriteUncommitted writes reader as uncommitted Lance data files.

func WriteUncommittedWithAccessor

func WriteUncommittedWithAccessor(uri string, reader array.RecordReader, opts WriteUncommittedOptions, accessor *StorageOptionsAccessor) (*Transaction, error)

WriteUncommittedWithAccessor writes uncommitted data files using a reusable storage options accessor. The transaction metadata does not retain the accessor; pass it again when committing.

func WriteUncommittedWithNativeOptions

func WriteUncommittedWithNativeOptions(uri string, reader array.RecordReader, mode WriteMode, options *NativeWriteOptions) (*Transaction, error)

WriteUncommittedWithNativeOptions stages reader using an owned native options handle. The returned transaction does not retain the options handle.

func (*Transaction) Close

func (tx *Transaction) Close()

Close releases the transaction handle. It is idempotent.

func (*Transaction) HasProperties

func (tx *Transaction) HasProperties() (bool, error)

HasProperties reports whether the native property map is Some, including Some(empty).

func (*Transaction) MarshalBinary

func (tx *Transaction) MarshalBinary() ([]byte, error)

MarshalBinary serializes the transaction through native protobuf conversion.

func (*Transaction) NativeHandle

func (t *Transaction) NativeHandle() uintptr

NativeHandle returns the native transaction handle for internal call sites that hold an independent transaction lease.

func (*Transaction) Operation

func (tx *Transaction) Operation() (*Operation, error)

Operation clones the transaction's operation.

func (*Transaction) Properties

func (tx *Transaction) Properties() (map[string]string, bool, error)

Properties returns the native transaction property map. The boolean reports whether the map is present, distinguishing absent from present-empty.

func (*Transaction) PropertyCount

func (tx *Transaction) PropertyCount() (uint64, error)

PropertyCount returns the native transaction property count.

func (*Transaction) ReadVersion

func (tx *Transaction) ReadVersion() (uint64, error)

ReadVersion returns the native read version. Zero is valid for an uncommitted create.

func (*Transaction) Tag

func (tx *Transaction) Tag() (string, bool, error)

Tag returns the optional transaction tag.

func (*Transaction) UUID

func (tx *Transaction) UUID() (string, error)

UUID returns the native transaction UUID.

type TransactionOptions

type TransactionOptions struct {
	UUID          *string
	Tag           *string
	Properties    map[string]string
	HasProperties bool
}

TransactionOptions controls native transaction construction.

type UpdateColumnsResult

type UpdateColumnsResult struct {
	// contains filtered or unexported fields
}

UpdateColumnsResult is the owned result of a native fragment update.

func (*UpdateColumnsResult) Close

func (r *UpdateColumnsResult) Close()

Close releases the native result. It is idempotent.

func (*UpdateColumnsResult) FieldsModified

func (r *UpdateColumnsResult) FieldsModified() ([]uint32, error)

FieldsModified returns the native modified field IDs in native order.

func (*UpdateColumnsResult) Fragment

func (r *UpdateColumnsResult) Fragment() (*Fragment, error)

Fragment clones the detached updated fragment metadata.

func (*UpdateColumnsResult) MatchedOffsets

func (r *UpdateColumnsResult) MatchedOffsets() ([]uint32, error)

MatchedOffsets returns an owned copy of the matched physical row offsets in native bitmap order.

type UpdateOperationOptions

type UpdateOperationOptions struct {
	UpdatedFragments       []*Fragment
	FieldsModified         []uint32
	UpdatedFragmentOffsets *UpdatedFragmentOffsets
}

UpdateOperationOptions carries the subset of native Update options needed to publish fragment update results.

type UpdatedFragmentOffsets

type UpdatedFragmentOffsets struct {
	// contains filtered or unexported fields
}

UpdatedFragmentOffsets is the owned native representation of physical row offsets grouped by fragment ID. Native owns ordering, duplicate handling and the underlying bitmap representation.

func NewUpdatedFragmentOffsets

func NewUpdatedFragmentOffsets(entries []FragmentOffsets) (*UpdatedFragmentOffsets, error)

NewUpdatedFragmentOffsets copies entries into an owned native offsets value. Pass nil to produce the explicit empty value; omit the value entirely from NewUpdateOperation to represent native None.

func (*UpdatedFragmentOffsets) Clone

Clone returns an independently owned copy.

func (*UpdatedFragmentOffsets) Close

func (o *UpdatedFragmentOffsets) Close()

Close releases the native value. It is idempotent.

func (*UpdatedFragmentOffsets) Count

func (o *UpdatedFragmentOffsets) Count() (uint64, error)

Count returns the number of fragment entries.

func (*UpdatedFragmentOffsets) FragmentIDAt

func (o *UpdatedFragmentOffsets) FragmentIDAt(index uint64) (uint64, error)

FragmentIDAt returns the fragment ID of one entry.

func (*UpdatedFragmentOffsets) OffsetsAt

func (o *UpdatedFragmentOffsets) OffsetsAt(index uint64) ([]uint32, error)

OffsetsAt returns an owned copy of every offset of one fragment entry in native order.

type VectorIndexOptions

type VectorIndexOptions struct {
	IndexType int32
	Metric    int32

	NumPartitions         *uint64
	TargetPartitionSize   *uint64
	MaxIters              *uint64
	SampleRate            *uint64
	StreamingSampleRate   *uint64
	StreamingCoresetRate  *uint64
	StreamingRefinePasses uint64

	PrecomputedPartitionsFile   string
	PrecomputedShuffleBuffers   *PrecomputedShuffleBuffers
	ShufflePartitionBatches     *uint64
	ShufflePartitionConcurrency *uint64
	StorageOptions              map[string]string

	NumSubVectors   *uint64
	NumBits         *uint64
	IVFCentroids    arrow.Array
	PQCodebook      arrow.Array
	RabitQModelJSON []byte

	HNSWMaxLevel       *uint64
	HNSWM              *uint64
	HNSWEFConstruction *uint64

	FileVersion   int32
	SkipTranspose bool
	RuntimeHints  map[string]string

	Train *bool
}

VectorIndexOptions holds native vector index build options. Optional fields are nil when absent; Arrow models are FixedSizeList arrays owned by the caller for the duration of the call.

type VectorOptions

type VectorOptions struct {
	Nearest          *NearestQuery
	Metric           *int32
	NProbes          *uint32
	MinNProbes       *uint32
	MaxNProbes       *uint32
	EF               *uint32
	RefineFactor     *uint32
	SearchEffort     *float64
	ApproxMode       *int32
	QueryParallelism *int32
	UseIndex         *bool
	FastSearch       *bool
	Prefilter        *bool
	LowerDistance    *float32
	UpperDistance    *float32
	RowAllowlist     []uint64
	RowAllowlistSet  bool
	RowBlocklist     []uint64
	RowBlocklistSet  bool
}

VectorOptions configures vector search and row masks. A nil pointer leaves the corresponding native default in place. Row masks use stable _rowid values; a set-but-empty mask therefore selects or excludes no rows.

type VersionInfo

type VersionInfo struct {
	ID        uint64
	Timestamp time.Time
	Metadata  map[string]string
}

VersionInfo is one snapshot of a committed dataset version.

type WriteFragmentProgress

type WriteFragmentProgress struct {
	FragmentID   uint64
	PhysicalRows *uint64
	FileCount    uint64
}

WriteFragmentProgress is one native begin- or complete-fragment event.

type WriteMode

type WriteMode int32

WriteMode mirrors LanceWriteMode.

const (
	WriteModeCreate    WriteMode = 0
	WriteModeAppend    WriteMode = 1
	WriteModeOverwrite WriteMode = 2
)

type WriteOptions

type WriteOptions struct {
	Mode            WriteMode
	Params          WriteParams
	AutoCleanup     *AutoCleanupParams
	SkipAutoCleanup bool
}

WriteOptions controls a dataset write.

type WriteParams

type WriteParams struct {
	MaxRowsPerFile     uint64
	MaxRowsPerGroup    uint64
	MaxBytesPerFile    uint64
	DataStorageVersion string
	EnableStableRowIDs bool
}

WriteParams mirrors LanceWriteParams. Zero values select native defaults, except EnableStableRowIDs which is always forwarded explicitly.

type WriteProgress

type WriteProgress struct {
	BeginFragment    func(WriteFragmentProgress) error
	CompleteFragment func(WriteFragmentProgress) error
	WriteStats       func(WriteStats)
}

WriteProgress receives native write callbacks. Callbacks run on native worker threads and must be safe for concurrent use.

type WriteStats

type WriteStats struct {
	BytesWritten uint64
	RowsWritten  uint64
	FilesWritten uint32
}

WriteStats is a native cumulative write-statistics snapshot.

type WriteUncommittedOptions

type WriteUncommittedOptions struct {
	Write                 WriteOptions
	StorageOptions        map[string]string
	TransactionProperties map[string]string
	HasProperties         bool
	Session               *Session
	// CommitLock routes staged commit acquisition through an external lock.
	// Static StorageOptions are not accepted on this path.
	CommitLock *CommitLock
}

WriteUncommittedOptions augments a write with uncommitted transaction properties.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL