Repository navigation
table: add error-preserving count and version getters - #80
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Add status-returning siblings of the two scalar table getters:
Both bind
Table::count_rows(None)andTable::version()and report SDK failures throughLanceDBErrorplus the existing error-message mechanism. On failure the output value is left untouched. A successful count of0for an empty table is therefore distinct from a failed call.lancedb_table_count_rowsandlancedb_table_versionkeep their existing signatures and zero sentinel, and their documented behavior is unchanged.Verification
cargo fmt --checkg++ -std=c++20 -Wall -Wextra -Wtype-limits -fsyntax-onlyovertests/test_table.cppwith the public headerThe full Rust build and C++ test suite are left to hosted CI on the exact head.
Integration notes
runtime::run_blockingand changesconnection::get_runtime()to return aResult. This branch keeps the currentget_runtime().block_on(...)pattern so it is independent of Run C API work on the runtime's worker threads, not the caller's stack #76. Whichever lands second must switch the two new getters torun_blocking(or rebase accordingly).lancedb 0.42.0-beta.21;Table::count_rows(Option<String>)andTable::version()keep their signatures there, so no source change is needed for this slice.