From bdf5dfe5188014738a9f0fd571ee8fb77da778dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 15:20:46 +0000 Subject: [PATCH 1/2] chore(deps): bump clap from 4.5.4 to 4.5.21 Bumps [clap](https://github.com/clap-rs/clap) from 4.5.4 to 4.5.21. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.4...clap_complete-v4.5.21) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bd39d8..ae14dca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,9 +52,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -200,9 +200,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.4" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -210,9 +210,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -222,9 +222,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 3e5cf31..d6bf29b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ revision = "" [dependencies] anyhow = "1.0.93" -clap = { version = "4.5.4", features = ["derive"] } +clap = { version = "4.5.21", features = ["derive"] } crossterm = "0.28.1" futures = "0.3.31" hex = "0.4.3" From 4f0be991fca0ebec5e9f792e436a8271642eb31e Mon Sep 17 00:00:00 2001 From: Attila Repka Date: Tue, 26 Nov 2024 16:48:57 +0100 Subject: [PATCH 2/2] fix(sqlx): limit in memory db connections --- src/db.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/db.rs b/src/db.rs index 5a6eeee..f83f284 100644 --- a/src/db.rs +++ b/src/db.rs @@ -3,7 +3,7 @@ use anyhow::Result; use serde_json::{json, Value}; use sqlx::{ - sqlite::{SqliteConnectOptions, SqliteRow}, + sqlite::{SqliteConnectOptions, SqlitePoolOptions, SqliteRow}, Column, QueryBuilder, Row, SqlitePool, TypeInfo, }; @@ -14,8 +14,12 @@ pub struct Sqlite { impl Sqlite { pub async fn new() -> Result { + let sqlite_opts = SqliteConnectOptions::new().in_memory(true); Ok(Sqlite { - pool: SqlitePool::connect(":memory:").await?, + pool: SqlitePoolOptions::new() + .max_connections(1) + .connect_with(sqlite_opts) + .await?, }) }