LanceDB.Branch (LanceDB v0.2.0)

Copy Markdown View Source

Independent branch handles and branch management.

Summary

Functions

Creates a writable branch and returns a new handle without changing table. :from defaults to :current (the handle's visible version), or accepts a version on the current branch, {:tag, name}, {:branch, name}, or {:branch, name, version}. Historical handles cannot create branches. The pinned SDK creates a new session with default cache budgets for the returned branch; it does not retain the source session's configured budgets.

Returns the handle's branch name, using "main" for the default branch.

Deletes a branch. Historical handles cannot delete branches; SDK reference restrictions apply.

Lists branches by name with parent branch/version, creation timestamp, manifest size and metadata.

Opens a separate handle on a branch, leaving table unchanged. :version pins the new handle read-only; omitted, it opens a live handle at the branch's latest version. Later changes follow the handle's read-consistency policy. Use "main" to return a handle on the main branch. Checkout preserves the source handle's native session and cache budgets.

Types

result(value)

@type result(value) :: LanceDB.result(value)

table()

@type table() :: LanceDB.Table.t()

Functions

create(table, name, opts \\ [])

@spec create(table(), String.t(), keyword()) :: result(table())

Creates a writable branch and returns a new handle without changing table. :from defaults to :current (the handle's visible version), or accepts a version on the current branch, {:tag, name}, {:branch, name}, or {:branch, name, version}. Historical handles cannot create branches. The pinned SDK creates a new session with default cache budgets for the returned branch; it does not retain the source session's configured budgets.

current(table)

@spec current(table()) :: result(String.t())

Returns the handle's branch name, using "main" for the default branch.

delete(table, name)

@spec delete(table(), String.t()) :: result(:deleted)

Deletes a branch. Historical handles cannot delete branches; SDK reference restrictions apply.

list(table)

@spec list(table()) :: result(map())

Lists branches by name with parent branch/version, creation timestamp, manifest size and metadata.

open(table, name, opts \\ [])

@spec open(table(), String.t(), keyword()) :: result(table())

Opens a separate handle on a branch, leaving table unchanged. :version pins the new handle read-only; omitted, it opens a live handle at the branch's latest version. Later changes follow the handle's read-consistency policy. Use "main" to return a handle on the main branch. Checkout preserves the source handle's native session and cache budgets.