Subject: bug#61151: 30.0.50; sqlite-more-p is confusing

From: Eli Zaretskii <[email-masked]>
Date: Sun, 29 Jan 2023 17:25:44 +0200

> From: Helmut Eller <[email-masked]>
> Date: Sun, 29 Jan 2023 15:52:34 +0100
> 
> This code
> 
>   (let* ((db (sqlite-open))
>          (stmt (sqlite-select db "values ('a',0), ('b',1)" nil 'set))
>          (rows '()))
>     (while (sqlite-more-p stmt)
>       (push (sqlite-next stmt) rows))
>     rows)
> 
> returns: (nil ("b" 1) ("a" 0))
> 
> I would expect: (("b" 1) ("a" 0))
> 
> I think it would be more natural, if sqlite-more-p would return false
> before sqlite-next returns nil the first time.

I'm not sure I understand why you need sqlite-more-p here.
sqlite-next returns nil when it hits the end, so it should be enough.
If we document this fact in the doc string of sqlite-next, would that
be good enough to satisfy your use cases?