Skip to content

table: add error-preserving count and version getters - #80

Merged
Xuanwo merged 1 commit into
mainfrom
xuanwo/add-error-preserving-table-getters
Nov 21, 2026
Merged

Xuanwo merged 1 commit into
mainfrom
xuanwo/add-error-preserving-table-getters

Conversation

@Xuanwo

@Xuanwo Xuanwo commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

What

Add status-returning siblings of the two scalar table getters:

LanceDBError lancedb_table_count_rows_with_status(
    const LanceDBTable* table,
    size_t* count_out,
    char** error_message
);

LanceDBError lancedb_table_version_with_status(
    const LanceDBTable* table,
    uint64_t* version_out,
    char** error_message
);

Both bind Table::count_rows(None) and Table::version() and report SDK failures through LanceDBError plus the existing error-message mechanism. On failure the output value is left untouched. A successful count of 0 for an empty table is therefore distinct from a failed call.

lancedb_table_count_rows and lancedb_table_version keep their existing signatures and zero sentinel, and their documented behavior is unchanged.

Verification

  • cargo fmt --check
  • g++ -std=c++20 -Wall -Wextra -Wtype-limits -fsyntax-only over tests/test_table.cpp with the public header
  • New C++ regression exercises an empty table count of zero, the current version, a write, and rejected calls through the public ABI

The full Rust build and C++ test suite are left to hosted CI on the exact head.

Integration notes

Add status-returning siblings of lancedb_table_count_rows and lancedb_table_version. The existing getters keep their zero sentinel, while the new getters report SDK failures through the error code and message and leave the output untouched on failure. This lets callers tell an empty table with zero rows apart from a failed count.

The C++ regression covers a zero-row count, the current version, a write, and rejected calls through the public header.
@Xuanwo
Xuanwo merged commit 5c44472 into main Nov 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant