Skip to content

Commit

Permalink
Upgrade to latest sqlite everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
octol committed Oct 3, 2023
1 parent 56a384e commit f9fb3f6
Show file tree
Hide file tree
Showing 15 changed files with 289 additions and 225 deletions.
467 changes: 265 additions & 202 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ rand = "0.8.5"
reqwest = "0.11.18"
serde = "1.0.152"
serde_json = "1.0.91"
sqlx = "0.7.2"
tap = "1.0.1"
tendermint-rpc = "0.32" # same version as used by cosmrs
thiserror = "1.0.38"
Expand Down
4 changes: 2 additions & 2 deletions common/client-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ features = ["time"]
version = "0.14"

[target."cfg(not(target_arch = \"wasm32\"))".dependencies.sqlx]
version = "0.6.2"
workspace = true
features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"]
optional = true

Expand Down Expand Up @@ -88,7 +88,7 @@ tempfile = "3.1.0"

[build-dependencies]
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
sqlx = { version = "0.6.2", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }

[features]
default = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ impl StorageManager {
})?;
}

let mut opts = sqlx::sqlite::SqliteConnectOptions::new()
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(fresh);

opts.disable_statement_logging();
let opts = opts.disable_statement_logging();

let connection_pool = match sqlx::SqlitePool::connect_with(opts).await {
Ok(pool) => pool,
Expand Down
4 changes: 2 additions & 2 deletions common/credential-storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ thiserror = "1.0"
tokio = { version = "1.24.1", features = ["sync"]}

[target."cfg(not(target_arch = \"wasm32\"))".dependencies.sqlx]
version = "0.5"
workspace = true
features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"]

[target."cfg(not(target_arch = \"wasm32\"))".dependencies.tokio]
Expand All @@ -22,5 +22,5 @@ features = [ "rt-multi-thread", "net", "signal", "fs" ]


[build-dependencies]
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
4 changes: 2 additions & 2 deletions common/credential-storage/src/persistent_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ impl PersistentStorage {
database_path.as_ref().as_os_str()
);

let mut opts = sqlx::sqlite::SqliteConnectOptions::new()
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(true);

opts.disable_statement_logging();
let opts = opts.disable_statement_logging();

let connection_pool = match sqlx::SqlitePool::connect_with(opts).await {
Ok(db) => db,
Expand Down
2 changes: 1 addition & 1 deletion common/statistics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ log = { workspace = true }
reqwest = { workspace = true, features = ["json"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1"
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "chrono"]}
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "chrono"]}
thiserror = "1"
tokio = { version = "1.24.1", features = [ "time" ] }
2 changes: 1 addition & 1 deletion ephemera/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pretty_env_logger = "0.4"
refinery = { version = "0.8.7", features = ["rusqlite"], optional = true }
reqwest = { version = "0.11.6", features = ["json"] }
rocksdb = { version = "0.21.0", optional = true }
rusqlite = { version = "0.27.0", features = ["bundled"], optional = true }
rusqlite = { version = "0.29.0", features = ["bundled"], optional = true }
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0.149"
serde_json = "1.0.91"
Expand Down
4 changes: 2 additions & 2 deletions gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pretty_env_logger = "0.4"
rand = "0.7"
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx = { version = "0.5", features = [ "runtime-tokio-rustls", "sqlite", "macros", "migrate", ] }
sqlx = { workspace = true, features = [ "runtime-tokio-rustls", "sqlite", "macros", "migrate", ] }
subtle-encoding = { version = "0.5", features = ["bech32-preview"] }
thiserror = "1"
tokio = { workspace = true, features = [ "rt-multi-thread", "net", "signal", "fs", "time" ] }
Expand Down Expand Up @@ -66,7 +66,7 @@ nym-wireguard = { path = "../common/wireguard" }

[build-dependencies]
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
sqlx = { version = "0.5", features = [
sqlx = { workspace = true, features = [
"runtime-tokio-rustls",
"sqlite",
"macros",
Expand Down
4 changes: 2 additions & 2 deletions gateway/src/node/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@ impl PersistentStorage {

// TODO: we can inject here more stuff based on our gateway global config
// struct. Maybe different pool size or timeout intervals?
let mut opts = sqlx::sqlite::SqliteConnectOptions::new()
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(true);

// TODO: do we want auto_vacuum ?

opts.disable_statement_logging();
let opts = opts.disable_statement_logging();

let connection_pool = match sqlx::SqlitePool::connect_with(opts).await {
Ok(db) => db,
Expand Down
4 changes: 2 additions & 2 deletions nym-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ts-rs = { workspace = true, optional = true}
anyhow = "1.0"
getset = "0.1.1"

sqlx = { version = "0.6.2", features = [
sqlx = { workspace = true, features = [
"runtime-tokio-rustls",
"sqlite",
"macros",
Expand Down Expand Up @@ -113,7 +113,7 @@ generate-ts = ["ts-rs"]

[build-dependencies]
tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] }
sqlx = { version = "0.6.2", features = [
sqlx = { workspace = true, features = [
"runtime-tokio-rustls",
"sqlite",
"macros",
Expand Down
4 changes: 2 additions & 2 deletions nym-api/src/support/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ impl NymApiStorage {
pub async fn init<P: AsRef<Path>>(database_path: P) -> Result<Self, NymApiStorageError> {
// TODO: we can inject here more stuff based on our nym-api global config
// struct. Maybe different pool size or timeout intervals?
let mut opts = sqlx::sqlite::SqliteConnectOptions::new()
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(true);

// TODO: do we want auto_vacuum ?

opts.disable_statement_logging();
let opts = opts.disable_statement_logging();

let connection_pool = match sqlx::SqlitePool::connect_with(opts).await {
Ok(db) => db,
Expand Down
2 changes: 1 addition & 1 deletion service-providers/network-requester/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ regex = "1.8.4"
reqwest = { workspace = true, features = ["json"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
sqlx = { version = "0.6.1", features = ["runtime-tokio-rustls", "chrono"]}
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "chrono"]}
tap = { workspace = true }
thiserror = "1.0"
tokio = { version = "1.24.1", features = [ "net", "rt-multi-thread", "macros" ] }
Expand Down
4 changes: 2 additions & 2 deletions service-providers/network-statistics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ log = { workspace = true }
pretty_env_logger = "0.4"
rocket = { version = "0.5.0-rc.2", features = ["json"] }
serde = { workspace = true, features = ["derive"] }
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate", "chrono"]}
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate", "chrono"]}
thiserror = "1"
tokio = { version = "1.4", features = [ "net", "rt-multi-thread", "macros", "time" ] }
nym-bin-common = { path = "../../common/bin-common"}
nym-statistics-common = { path = "../../common/statistics" }
nym-task = { path = "../../common/task" }

[build-dependencies]
sqlx = { version = "0.5", features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
sqlx = { workspace = true, features = ["runtime-tokio-rustls", "sqlite", "macros", "migrate"] }
tokio = { version = "1.4", features = ["rt-multi-thread", "macros"] }
4 changes: 2 additions & 2 deletions service-providers/network-statistics/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ impl NetworkStatisticsStorage {
pub async fn init(base_dir: &PathBuf) -> Result<Self, NetworkStatisticsStorageError> {
std::fs::create_dir_all(base_dir)?;
let database_path = base_dir.join("db.sqlite");
let mut opts = sqlx::sqlite::SqliteConnectOptions::new()
let opts = sqlx::sqlite::SqliteConnectOptions::new()
.filename(database_path)
.create_if_missing(true);

opts.disable_statement_logging();
let opts = opts.disable_statement_logging();

let connection_pool = sqlx::SqlitePool::connect_with(opts).await?;

Expand Down

0 comments on commit f9fb3f6

Please sign in to comment.