Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are there utility APIs to know if a table is empty, number of rows/columns in it etc? #26

Closed
pkbehera opened this issue Dec 13, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@pkbehera
Copy link

pkbehera commented Dec 13, 2019

I don't see any APIs like this. I can know if the table is empty by checking if to_string returns empty, but an API will help!

@seleznevae
Copy link
Owner

Hi! Added functions ft_is_empty to C API and is_empty to C++ API and merged to develop branch.

@pkbehera
Copy link
Author

thanks for is_empty(), do apis like row_count() column_count() make sense?

@seleznevae
Copy link
Owner

Hard to say. I wouldn't hurry adding them. Don't want to add functions to API if it is not clear how they would be used. At first it seems easy. But maybe there can be some problems since it is possible to expand cells for several columns.
So I think it is better to leave it as is. Let's take a break and keep the issue open for some time. If somebody else wants this functions he'll write his thoughts about their necessity of these functions and we'll add them.

@pkbehera
Copy link
Author

I agree that columns can be be broken/merged, but I don't think same thing can be done with rows, so a row_count() API should not be problematic. In fact I saw that you are checking row_count() == 0 in is_empty()

@seleznevae
Copy link
Owner

Added function to get number of rows in the table. Resolving the issue.
Feel free to reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants