
6 Sep
2025
6 Sep
'25
6:56 p.m.
The 1 snippet unnecessarily prepares the statement for rebinding and reexecution when rs gets destroyed. Not a big deal, admitted. But I didn't expect both snippets would do the exact same sqlite API calls. Any makes me feel a bit icky about the life-time management around statement.
The other aspect that is surprising is that even if we ignore the subtlety of the lifetime footgun, on the flip side, if what you’re saying is accurate about the statement preparation, and only if accurate, then this means that users could end up running queries that they meant to be prepared statements, but due to this non-apparent subtlety in the type’s interface, you could end up pessimising your code by mistake. Claudio