
On Mon, 8 Sept 2025 at 21:10, Dominique Devienne via Boost <boost@lists.boost.org> wrote:
[sqlite3pp][1] has a statement class, that's the base abstract wrapper, adding RAII and typesafety (and overloading to drive higher abstractions). And separate command and query derived concrete classes, with "streaming" getters and "setters" (to bind) as syntax sugar.
i.e. there's no resultset at all. The "statement" remains the only object. There are more types on the query side, to support foreach loops, but not in a way that blur the real picture with a made-up resultset.
Yes, it's an old wrapper that hasn't kept pace. It's more abstraction are closer to the reality of SQLite IMHO. FWIW.
This sounds reasonable and avoids/resolves the area that feels most surprising in the proposed library, where the real sqlite model leaks through the somewhat forced mapping to a distinct resultset. The leakage is a pile of "don't do that" that would be obvious - if there wasn't a distinct object. Iterating over the (possibly non-existent) results of a statement seems fine. The statement being busy is a state not a distinct object. And viewing the step as forward iterating the statement itself, and there is no ïs it a ref or .. of course it is. There isn't anything else you can get from a statement other than results. This also relates to the patchy support for non throwing usage - is it a result or an exception" should be a simple question to answer. Throwing for a logic error where you have e.g. tried to iterate over a statement that hasn't been prepared but NOT throwing where the result of step is a legitimate "not a row" result like BUSY or even SCHEMA (change has invalidated the statement) fits better with my expectations at least, re using any SQL database. The fact in a simple enough program/usage you can ensure it is impossible to get these when using sqlite (rather than it being simply broken to assume you wont get them in a shared access database) doesn't mean the library interface should make more advanced usage ugly and require use of a more or completely raw sqlite3 interface.