Comments (10)
See gwenn@d8d220e
from rusqlite.
Ick. Great catch. I would like for that to not compile, but AFAICT an Iterator
impl can't return references to itself from next
, which is what I believe we'd need.
Options:
- Leave it as is and document it. This is related to the already-documented issue that if you call
next
twice, you'll get errors trying to access the first row which is now stale. - Don't reset when
Rows
is dropped, and go back toreset_if_needed
. We can keep thereset
on error /SQLITE_DONE
to still reset ASAP when possible.
Thoughts? Other options?
from rusqlite.
Another option is to deprecate/remove query
. We already recommend people use query_map
and/or query_and_then
instead, neither of which expose this problem.
from rusqlite.
Could you please confirm that the problem is related to streaming iterators ?
from rusqlite.
Yes, that's the exact problem.
from rusqlite.
I think #153 is a decent compromise. Keep Rows
but change next()
to return a Row<'a, 'stmt>
where 'a
is tied to the vending Rows
handle. This means Rows
no longer implements Iterator
, but it's at least still usable, and this change doesn't affect anyone using query_map
/query_and_then
.
from rusqlite.
This change breaks the current API (when users iterate on Rows), no ?
from rusqlite.
It does, yeah.
We're still in 0.x
versioning, so breaking changes are allowed between minor versions. I was okay with runtime checks to let Rows
implement Iterator
when the only thing that could go wrong was if you used a row after calling next()
again, but adding more runtime checks (or disabling resetting the statement when a Rows
is dropped) seems bad.
from rusqlite.
Ok.
from rusqlite.
Closed with #153.
from rusqlite.
Related Issues (20)
- libsqlite3-sys fails to build on arm64: error[E0308]: mismatched types HOT 2
- release the latest version HOT 4
- FromSql vs TryFrom / ToSql vs TryInto HOT 1
- `sqlite3_compileoption_used` and Rust `const fn`
- called `Result::unwrap()` on an `Err` value: SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("json_object() requires an even number of arguments")) HOT 2
- Apps using `winsqlite3` feature no longer builds HOT 5
- Question: Is there any way to use SQLite 3.45 with rusqlite 0.30.0? HOT 2
- Trait for abstracting over `Connection`/`Transaction`? HOT 3
- SqlInputError { error: Error { code: Unknown, extended_code: 1 }, msg: "unrecognized token: \"{\"" HOT 1
- Release 0.31.0 with SQLite 3.45? HOT 2
- Type issue on select with digits only in a "string" colums. HOT 2
- wasm32-wasi target fails on Apple M3
- How to get "returning *" from insert HOT 2
- Stale Connection Handler on Multi-Threaded Situation HOT 1
- sqlite3_snapshot iteration HOT 2
- Creating `Value::Blob` without necessarily allocating heap HOT 5
- Using rusqlite::vtab::VTabConnection::handle() HOT 4
- Add bindings for `sqlite3_trace_v2` API HOT 4
- iOS Linker Warning: SQLite was build for newer version than being linked HOT 2
- the first query is failure due to below error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rusqlite.