LanceDB.Metadata (LanceDB v0.2.0)

Copy Markdown View Source

Schema and field metadata operations.

Summary

Functions

Returns schema metadata as a map with string keys. An empty map returns %{}.

Updates field metadata and returns a WriteResult with the new version.

Merges schema metadata and returns a WriteResult with the new version.

Types

result(value)

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

table()

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

Functions

schema(table)

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

Returns schema metadata as a map with string keys. An empty map returns %{}.

update_field(table, path, changes, opts \\ [])

@spec update_field(table(), String.t() | atom(), map(), keyword()) ::
  result(LanceDB.WriteResult.t())

Updates field metadata and returns a WriteResult with the new version.

The field path can select a nested field. Merge and deletion use the same options as update_schema/3. Use replace: true to replace user metadata. An empty replacement map clears user metadata.

Replacement keeps extension markers that identify the field's logical type. An attempt to change these markers returns an unsupported error. LanceDB.Table.schema/1 returns the metadata for each field.

update_schema(table, changes, opts \\ [])

@spec update_schema(table(), map(), keyword()) :: result(LanceDB.WriteResult.t())

Merges schema metadata and returns a WriteResult with the new version.

Keys can be strings or atoms. Values must be UTF-8 strings. Use nil to delete a key. Use replace: true to replace the complete map. An empty replacement map clears all schema metadata. Historical handles reject updates.