Commit Graph

60 Commits

Author SHA1 Message Date
gwenn
2cb104a40b Impl Debug for Row 2022-10-09 11:43:02 +02:00
gwenn
d5110ced91 Fix clippy warnings 2022-07-31 07:00:37 +02:00
gwenn
618e9a1274 Clean code
Typos, deprecated code usages, ...
2022-05-29 13:33:51 +02:00
gwenn
c10e2f39ef clippy::single_match_else 2022-01-06 04:56:59 -08:00
gwenn
406ac6a7fc clippy::must_use_candidate 2022-01-06 04:56:24 -08:00
gwenn
01c4be82c8 clippy::doc_markdown 2022-01-06 04:54:10 -08:00
trevyn
c759bc7527 Consolidate to FromSqlError::InvalidBlobSize (breaking) 2022-01-02 18:24:56 -08:00
trevyn
7f09d295ba Add ToSql/FromSql for [u8; N] 2022-01-02 18:24:56 -08:00
gwenn
ce90b519bb Fix clippy warnings 2021-10-01 20:09:48 +02:00
gwenn
5730b2f952 Fix clippy warnings 2021-06-25 18:57:25 -07:00
gwenn
df02910660
Implement AsRef<Statement> for Row(s) (#887) 2021-05-26 14:51:28 +02:00
gwenn
cd40cc330b
Rustfmt (#956) 2021-05-07 19:39:53 +02:00
Dirk Stolle
c33d6bfad3 fix several typos 2021-05-02 23:03:10 -07:00
gwenn
c4b398f468
Doctest column name reference (#918)
* Doctest column name reference
* Document rusqlite assumption on column name reference
And move doctest as a test.
* Document when columns metadata should be extracted.
* Rustfmt doc (wrap_comments)
2021-04-03 11:03:50 +02:00
gwenn
e154ccb606
Rename get_raw to get_ref_unwrap and get_raw_checked to get_ref (#838)
* test `From<FromSqlError> for Error`
* Rename get_raw to get_ref_unwrap and get_raw_checked to get_ref
2020-12-22 21:34:30 +01:00
gwenn
6fae5d6641 Add/fix rustdoc links 2020-11-22 09:34:03 +01:00
gwenn
da94f8eba6 Make tests return Result 2020-11-05 22:14:00 +01:00
Thom Chiovoloni
65c38bf813 Add #[inline] and #[cold] in far more places 2020-11-04 07:59:23 -08:00
Thom Chiovoloni
22121772a2 Deprecate NO_PARAMS in favor of passing an empty array 2020-11-03 19:09:19 -08:00
Thom Chiovoloni
032aea73b8 Overhaul query API, removing the need for the _named variants of all functions, and rusqlite::NO_PARAMS 2020-11-03 19:09:19 -08:00
Thom Chiovoloni
c45446ba73 Seal the RowIndex trait (technically breaking, but unlikely to break anybody) 2020-11-03 19:09:19 -08:00
Michael Sproul
d7e0536b41
Add must_use attribute to iterators 2020-09-02 16:15:25 +10:00
gwenn
7b08dc9ad5 Try to explain why we need a map function
To tranform the fallible streaming iterator.
2020-06-02 19:05:09 +02:00
gwenn
8cb5b2e585 Document Rows::map and FallibleStreamingIterator impl
See
https://www.reddit.com/r/rust/comments/gov817/rusqlite_only_getting_ok_entries_from_query_map/
```
let mut stmt = self
    .db
    .prepare("SELECT tag FROM tags WHERE tags.entry_id = ?1")?;

let tags = stmt.query(params![id])?;

tags
    .map(|res| res.get(0))
    .collect()
```
2020-05-24 20:53:52 +02:00
gwenn
76fc22c653 Fix missing docs 2020-05-21 00:48:06 -07:00
Martin Habovstiak
8a08dff115 Clippy reports redundant closures even in cases in which removing the
closure is impossible. See
https://github.com/rust-lang/rust-clippy/issues/5594

Allow this lint until the issue is resolved in clippy or the compiler.
2020-05-21 00:47:52 -07:00
Martin Habovstiak
c5b2efc099 impl TryFrom<&Row<'_>> for (...)
This change implements `TryFrom<&Row>` for tuples up to 16 fields. This
is a convenience function that can be used to map rows more easily.

The change includes tests for 1-tuple, 2-tuple and 16-tuple.
2020-05-21 00:47:52 -07:00
Thom Chiovoloni
d35dd0e99f
Allow optionally passing an Error parameter to rusqlite::Result (#678) 2020-04-06 14:43:06 -07:00
Thom Chiovoloni
9b040da029
Add Rows::{mapped,and_then} to get an Iterator out of a Rows i… (#676) 2020-04-06 13:01:39 -07:00
gwenn
9ce3b82570 Make column_name returns a Result 2019-08-31 12:17:48 +02:00
Pro
d46eb23364 Make column_name() public
Changes it's interface to Option<&str> to accommodate for out of bounds index
2019-08-22 16:38:43 +02:00
gwenn
208f3c084b Clippy: fix warnings 2019-07-10 21:10:12 +02:00
Thom Chiovoloni
4356f5a176 Include the name of the column in InvalidColumnType errors 2019-06-25 12:20:11 -07:00
Simon Bernier St-Pierre
c42175a424 add support for Uuid 2019-04-08 14:19:42 -04:00
gwenn
80205da623 Rustfmt + clippy 2019-03-21 19:13:55 +01:00
gwenn
38e92159fb Introduce Statement::columns
Return Columns name and type. (#494)
2019-03-19 20:33:36 +01:00
gwenn
71a2004894 Add Rows::map method 2019-03-10 12:58:20 +01:00
gwenn
59a44cfae5 Merge remote-tracking branch 'jgallagher/master' into fallible-iterator 2019-03-10 11:12:14 +01:00
gwenn
6d9ae896b5 Do not panic by default
Replace `Row::get` by `Row::get_checked`,
And rename original `Row::get` to `Row::get_unwrap`.
`Stmt::query_map`, `Stmt::query_map_named`, `Stmt::query_row`,
`Conn::query_row` and `Conn::query_row_named` callback parameter must return a `Result`.
2019-02-21 20:48:09 +01:00
gwenn
2c1483f2e7 Merge remote-tracking branch 'jgallagher/master' into fallible-iterator 2019-02-09 06:47:57 +01:00
gwenn
7c5bfb7cc3
Merge pull request #475 from gwenn/db-config
Support for sqlite3_db_config #468
2019-02-08 21:38:01 +01:00
gwenn
d93dec52c0 Make Rows implement FallibleStreamingIterator 2019-02-03 14:01:42 +01:00
gwenn
e9896a7734 Lifetime elision in impl 2019-02-03 11:02:38 +01:00
gwenn
519ef9dc84 Fix rustdoc warnings 2019-02-02 15:18:11 +01:00
gwenn
d874180333 Rust 2018 idioms 2018-12-07 21:57:04 +01:00
gwenn
dc49b28520 Fix some clippy warnings 2018-12-06 19:00:55 +01:00
gwenn
f04047db01 Rust 2018 2018-10-30 20:15:08 +01:00
gwenn
1598d4bc30 Rustfmt 2018-10-28 08:51:02 +01:00
gwenn
0d08bf5e05
Merge pull request #411 from thomcc/i128_blob
Add a feature for storing i128 as blobs.
2018-10-19 21:49:09 +02:00
Thom Chiovoloni
3d82f7199a Allow getting a ValueRef out of Row and Context, fixes #259 2018-10-18 12:14:38 -07:00