Skip to content

Commit b74c25e

Browse files
committed
Dependabot fixes:
Upgrade rusqlite to fix libsqlite3-sys.
1 parent 6d1c6d8 commit b74c25e

File tree

3 files changed

+44
-40
lines changed

3 files changed

+44
-40
lines changed

Cargo.lock

Lines changed: 35 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ default-features = false
7575

7676
[dependencies.rusqlite]
7777
# TODO: Switch to sqlx for async sql support?
78-
version = "0.24"
78+
version = "0.33"
7979
features = [
8080
# Use a bundled, statically-linked version of sqlite. (Simplifies building on Windows)
8181
"bundled",

src/backend/sqlite.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use actix_web::web::Bytes;
1616
use backend::{FileMeta, RowCallback, SHA512};
1717
use log::{debug, warn};
1818
use r2d2_sqlite::SqliteConnectionManager;
19-
use rusqlite::{DatabaseName, NO_PARAMS, OpenFlags, named_params};
19+
use rusqlite::{named_params, params_from_iter, DatabaseName, OpenFlags};
2020
use sodiumoxide::randombytes::randombytes;
2121
use crate::backend::{self, UserID, Signature, ItemRow, ItemDisplayRow, Timestamp, ServerUser, QuotaDenyReason};
2222

@@ -398,7 +398,7 @@ impl Connection
398398
OR (user_id = :uid AND signature > :sig)
399399
ORDER BY user_id, signature
400400
")?;
401-
rows = stmt.query_named(named_params! {
401+
rows = stmt.query(named_params! {
402402
"uid": uid.bytes(),
403403
"sig": sig.bytes(),
404404
})?;
@@ -581,7 +581,7 @@ impl backend::Backend for Connection
581581
};
582582

583583
let mut stmt = self.conn.prepare(query)?;
584-
let mut rows = stmt.query(params)?;
584+
let mut rows = stmt.query(params_from_iter(params))?;
585585

586586

587587
let to_item_profile_row = |row: &Row<'_>| -> Result<ItemDisplayRow, Error> {
@@ -657,7 +657,7 @@ impl backend::Backend for Connection
657657
};
658658

659659
let mut stmt = self.conn.prepare(query)?;
660-
let mut rows = stmt.query(params)?;
660+
let mut rows = stmt.query(params_from_iter(params))?;
661661

662662
let convert = |row: &Row<'_>| -> Result<ItemRow, Error> {
663663
let item = ItemRow{
@@ -801,7 +801,7 @@ impl backend::Backend for Connection
801801

802802
let mut stmt = self.conn.prepare(&query)?;
803803

804-
let mut rows = stmt.query_named(&[
804+
let mut rows = stmt.query(&[
805805
(":timestamp", &timestamp.unix_utc_ms),
806806
])?;
807807

@@ -869,7 +869,7 @@ impl backend::Backend for Connection
869869
ORDER BY on_homepage, user_id
870870
")?;
871871

872-
let mut rows = stmt.query(NO_PARAMS)?;
872+
let mut rows = stmt.query([])?;
873873

874874
while let Some(row) = rows.next()? {
875875
let on_homepage: isize = row.get(2)?;
@@ -1041,7 +1041,7 @@ impl backend::Backend for Connection
10411041
)
10421042
")?;
10431043

1044-
let mut result = query.query_named(&[
1044+
let mut result = query.query(&[
10451045
(":user_id", &user_id.bytes())
10461046
])?;
10471047

@@ -1555,7 +1555,7 @@ fn get_follows(conn: &Connection, user_id: &UserID) -> Result<HashMap<UserID, Fo
15551555
WHERE p.user_id = :user_id
15561556
")?;
15571557

1558-
let mut rows = stmt.query_named(&[
1558+
let mut rows = stmt.query(&[
15591559
(":user_id", &user_id.bytes()),
15601560
])?;
15611561

0 commit comments

Comments
 (0)