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

Add length property #40

Open
FraMecca opened this issue Oct 7, 2017 · 4 comments
Open

Add length property #40

FraMecca opened this issue Oct 7, 2017 · 4 comments
Labels
Unsure Needs confirmation or more info

Comments

@FraMecca
Copy link

FraMecca commented Oct 7, 2017

It is useful for test, currently WalkLength pops elements

@biozic
Copy link
Collaborator

biozic commented Nov 1, 2017

Sorry, can you elaborate on where you would like to have a length property ?

@FraMecca
Copy link
Author

FraMecca commented Nov 6, 2017

I'd like to have a lenght on ResultEntities instances that could be useful for tests and other conditions.
At the current state it is only possible to know if the range is empty or not.

@biozic
Copy link
Collaborator

biozic commented Nov 6, 2017

You mean a length property that returns the total number of Rows in a ResultRange, right?
There's no API to do that in SQLite: the rows are just stepped over until there is none.
You should use SQL for this (or maybe use the deprecated not-recommended sqlite_get_table function).

@Robert-M-Muench
Copy link

Robert-M-Muench commented Jun 29, 2018

This can be simulated by using: SELECT count(*) FROM... which gives you the length of the result set. SQLite is pretty quick so the costs are not to high.

@biozic biozic added the Unsure Needs confirmation or more info label Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Unsure Needs confirmation or more info
Projects
None yet
Development

No branches or pull requests

3 participants