iwongu / sqlite3pp

SQLite3++ - C++ wrapper of SQLite3 API
MIT License
609 stars 177 forks source link

Query iterator has unexpected side effects #64

Closed eugene-kulak closed 4 years ago

eugene-kulak commented 4 years ago

Currently, if you call begin two or more times you will skip records as the cursor will be moved every time. This is not how begin should behave and definitely not what most people expect from. Typical use case - check if the result has any rows

qry.begin() != qry.end()

and then iterate

iwongu commented 4 years ago

It's unfortunate to have this limitation. I used the std::input_iterator_tag to tell that it's a single pass iterator.