You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 25, 2020. It is now read-only.
The function sqlite3_errmsg returns the error message from "the most recent call". If this is going to be exposed then every single function calling a sqlite3_* function needs to take a mutable self, otherwise this function will be racy.
Probably the better thing is to not expose this message and instead bundle its result into any Errs that are returned from SqliteResult-returning function, since it is not very Rustic to have error reporting be separated from error occurance like this.
The text was updated successfully, but these errors were encountered:
lifthrasiir
added a commit
to lifthrasiir/rustsqlite
that referenced
this issue
Jul 30, 2014
- fixed a mistake that `Database` was accidentally `Send`able.
- made `Cursor::{reset, clear_bindings, step, step_row,
get_blob, get_int, get_i64, get_f64, get_text, bind_param,
bind_params}` receive `&mut self`.
- made `Database::set_busy_timeout` receive `&mut self`.
`Database::{prepare, exec}` has been left as is, since it is
perfectly safe to have multiple cursors. the associated
thread safety issue is separately handled.
closeslinuxfood#98, linuxfood#99, linuxfood#100, linuxfood#101, linuxfood#102 and linuxfood#103.
Ditto for Database::get_changes() and Database::get_last_insert_rowid(), which are the kind of functions that should be safe to call from multiple threads, provided that no thread has mutable access. Rust can enforce this (allowing the Database to be both Send and Share) but every method which modifies the underlying database (exec at least) would need to take a &mut self, as per my other bug report(s).
I think the correct model for mapping between the Rust Database and the database is that anything that might mutate the database should require mutable access to the Database, exactly so that these functions can work in a threadsafe way.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The function
sqlite3_errmsg
returns the error message from "the most recent call". If this is going to be exposed then every single function calling asqlite3_*
function needs to take a mutable self, otherwise this function will be racy.Probably the better thing is to not expose this message and instead bundle its result into any
Err
s that are returned fromSqliteResult
-returning function, since it is not very Rustic to have error reporting be separated from error occurance like this.The text was updated successfully, but these errors were encountered: