From cdec1fb4519ad185ff2f2d1180044f7d1c5db1cf Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Wed, 19 Aug 2026 15:31:40 +0100 Subject: [PATCH 01/22] Initial outline of backup/restore --- src/db_service.rs | 7 +++++++ src/graphql/mod.rs | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/db_service.rs b/src/db_service.rs index 0445014..fb0a312 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -323,6 +323,13 @@ impl SqliteScanPathService { .collect()) } + pub async fn insert_configurations( + &self, + configs: &[InstrumentConfiguration], + ) -> Result<(), ()> { + todo!() + } + pub async fn next_scan_configuration( &self, instrument: &str, diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 707d42b..966df69 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -26,6 +26,7 @@ use async_graphql::{ }; use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use auth::{AuthError, PolicyCheck}; +use axum::extract::State; use axum::http::StatusCode; use axum::response::{Html, IntoResponse}; use axum::routing::{get, post}; @@ -67,7 +68,7 @@ pub async fn serve_graphql(opts: ServeOptions) { let schema = Schema::build(Query, Mutation, EmptySubscription) .extension(Tracing) .limit_directives(32) - .data(db) + .data(db.clone()) .data(directory_numtracker) .data(opts.policy.map(PolicyCheck::new)) .finish(); @@ -75,6 +76,8 @@ pub async fn serve_graphql(opts: ServeOptions) { // status check endpoint allows external processes to monitor status of server without // making graphql queries .route("/status", get(server_status)) + .route("/admin/export", get(export_handler)) + // .route("/admin/restore", post(restore_handler)) .route("/graphql", post(graphql_handler)) // make it obvious that /graphql isn't expected to work when visiting from a browser .route( @@ -88,6 +91,7 @@ pub async fn serve_graphql(opts: ServeOptions) { // Interactive graphiql playground .route("/graphiql", get(graphiql)) // Make it look less like something is broken when going to any other page + .with_state(db) .fallback(( StatusCode::NOT_FOUND, Html(include_str!("../../static/404.html")), @@ -102,6 +106,11 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } +async fn export_handler(State(db): State) -> String { + let configs = db.all_configurations().await; + return format!("{configs:?}"); +} + async fn create_signal_handler() { let mut term = signal(SignalKind::terminate()).expect("Failed to create SIGTERM listener"); let mut int = signal(SignalKind::interrupt()).expect("Failed to create SIGINT listener"); From 9df360d12b2deada1f67c1c4aa29f7f490477cc0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:54:52 +0000 Subject: [PATCH 02/22] Update Rust crate tokio to v1.53.1 (#288) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [tokio](https://tokio.rs) ([source](https://redirect.github.com/tokio-rs/tokio)) | dependencies | minor | `1.52.1` β†’ `1.53.1` | --- ### Release Notes
tokio-rs/tokio (tokio) ### [`v1.53.1`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.53.1): Tokio v1.53.1 [Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.53.0...tokio-1.53.1) ### 1.53.1 (July 20th, 2026) ##### Fixed - signal: restore MSRV by removing `OnceLock::wait` from the Windows handler ([#​8300]) ##### Fixed (unstable) - time: fix alt timer cancellation and insertion race ([#​8252]) ##### Documented - runtime: remove dead link definition in Runtime::block\_on ([#​8301]) [#​8252]: https://redirect.github.com/tokio-rs/tokio/pull/8252 [#​8300]: https://redirect.github.com/tokio-rs/tokio/pull/8300 [#​8301]: https://redirect.github.com/tokio-rs/tokio/pull/8301 ### [`v1.53.0`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.53.0): Tokio v1.53.0 [Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.4...tokio-1.53.0) ### 1.53.0 (July 17th, 2026) ##### Added - fs: implement `From` and `From` for `File` ([#​8266]) - metrics: add task schedule latency metric ([#​7986]) - net: add `SocketAddr` methods to Unix sockets ([#​8144]) ##### Changed - io: add `#[inline]` to IO trait impls for in-memory types ([#​8242]) - net: implement UCred::pid on FreeBSD ([#​8086]) - net: support Nuttx target os ([#​8259]) - signal: refactor global variables on Windows ([#​8231]) - sync: `mpsc::{Receiver,UnboundedReceiver}` now drops waker on drop, even if there are still senders ([#​8095]) - taskdump: support taskdumps on s390x ([#​8192]) - time: add `#[track_caller]` to `timeout_at()` ([#​8077]) - time: consolidate mutex locks on spurious poll ([#​8124]) - time: defer waker clone on spurious poll ([#​8107]) - time: move lazy-registration state into `Sleep` ([#​8132]) - tracing: remove unnecessary span clone ([#​8126]) ##### Fixed - io: do not treat zero-length reads as EOF in `Chain` ([#​8251]) - net: use getpeereid for QNX peer credentials ([#​8270]) - runtime: avoid illegal state in `FastRand` ([#​8078]) - sync: wake mpsc receiver when a queued `reserve[_many]` returns permits ([#​8260]) - taskdump: skip double wake on `Trace::capture`/`Trace::trace_with` ([#​8043]) - time: avoid stack overflow in runtime constructor ([#​8093]) - time (alt timer): ensure timers stay in the same runtime after `.reset()` ([#​8169]) ##### IO uring (unstable) - fs: use io-uring for `fs::try_exists` ([#​8080]) - fs: use io-uring for renaming files ([#​7800]) - rt: flush io-uring CQE in case of CQE overflow ([#​8277]) ##### Documented - docs: clarify cancel safety wording ([#​8181]) - fs: clarify `create_dir_all` succeeds if path exists ([#​8149]) - io: add warning about stdout reordering with multiple handles ([#​8276]) - net: document pipe `try_read*`/`try_write*` readiness behavior ([#​8032]) - runtime: document interaction with fork() ([#​8202]) - sync: clarify broadcast lagging semantics ([#​8239]) - sync: document memory ordering guarantees for Semaphore ([#​8119]) - task: explain why `yield_now` defers its waker ([#​8254]) - time: add panic docs to `timeout_at()` ([#​8077]) - time: fix reversed poll order in timeout doc ([#​8214]) [#​7800]: https://redirect.github.com/tokio-rs/tokio/pull/7800 [#​7986]: https://redirect.github.com/tokio-rs/tokio/pull/7986 [#​8032]: https://redirect.github.com/tokio-rs/tokio/pull/8032 [#​8043]: https://redirect.github.com/tokio-rs/tokio/pull/8043 [#​8077]: https://redirect.github.com/tokio-rs/tokio/pull/8077 [#​8078]: https://redirect.github.com/tokio-rs/tokio/pull/8078 [#​8080]: https://redirect.github.com/tokio-rs/tokio/pull/8080 [#​8086]: https://redirect.github.com/tokio-rs/tokio/pull/8086 [#​8093]: https://redirect.github.com/tokio-rs/tokio/pull/8093 [#​8095]: https://redirect.github.com/tokio-rs/tokio/pull/8095 [#​8107]: https://redirect.github.com/tokio-rs/tokio/pull/8107 [#​8119]: https://redirect.github.com/tokio-rs/tokio/pull/8119 [#​8124]: https://redirect.github.com/tokio-rs/tokio/pull/8124 [#​8126]: https://redirect.github.com/tokio-rs/tokio/pull/8126 [#​8132]: https://redirect.github.com/tokio-rs/tokio/pull/8132 [#​8144]: https://redirect.github.com/tokio-rs/tokio/pull/8144 [#​8149]: https://redirect.github.com/tokio-rs/tokio/pull/8149 [#​8169]: https://redirect.github.com/tokio-rs/tokio/pull/8169 [#​8181]: https://redirect.github.com/tokio-rs/tokio/pull/8181 [#​8192]: https://redirect.github.com/tokio-rs/tokio/pull/8192 [#​8193]: https://redirect.github.com/tokio-rs/tokio/pull/8193 [#​8202]: https://redirect.github.com/tokio-rs/tokio/pull/8202 [#​8214]: https://redirect.github.com/tokio-rs/tokio/pull/8214 [#​8231]: https://redirect.github.com/tokio-rs/tokio/pull/8231 [#​8239]: https://redirect.github.com/tokio-rs/tokio/pull/8239 [#​8242]: https://redirect.github.com/tokio-rs/tokio/pull/8242 [#​8251]: https://redirect.github.com/tokio-rs/tokio/pull/8251 [#​8254]: https://redirect.github.com/tokio-rs/tokio/pull/8254 [#​8259]: https://redirect.github.com/tokio-rs/tokio/pull/8259 [#​8260]: https://redirect.github.com/tokio-rs/tokio/pull/8260 [#​8266]: https://redirect.github.com/tokio-rs/tokio/pull/8266 [#​8270]: https://redirect.github.com/tokio-rs/tokio/pull/8270 [#​8276]: https://redirect.github.com/tokio-rs/tokio/pull/8276 [#​8277]: https://redirect.github.com/tokio-rs/tokio/pull/8277 ### [`v1.52.4`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.52.4): Tokio v1.52.4 [Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.3...tokio-1.52.4) ### 1.52.4 (July 16th, 2026) ##### Fixed - runtime: don't skip the driver when `before_park` schedules work ([#​8222]) ##### Fixed (unstable) - taskdump: remove crate disambiguators from output ([#​8264]) [#​8264]: https://redirect.github.com/tokio-rs/tokio/pull/8264 [#​8222]: https://redirect.github.com/tokio-rs/tokio/pull/8222 ### [`v1.52.3`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.52.3): Tokio v1.52.3 [Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.2...tokio-1.52.3) ### 1.52.3 (May 8th, 2026) ##### Fixed - sync: fix underflow in mpsc channel `len()` ([#​8062]) - sync: notify receivers in mpsc `OwnedPermit::release()` method ([#​8075]) - sync: require that an `RwLock` has `max_readers != 0` ([#​8076]) - sync: return `Empty` from `try_recv()` when mpsc is closed with outstanding permits ([#​8074]) [#​8062]: https://redirect.github.com/tokio-rs/tokio/pull/8062 [#​8074]: https://redirect.github.com/tokio-rs/tokio/pull/8074 [#​8075]: https://redirect.github.com/tokio-rs/tokio/pull/8075 [#​8076]: https://redirect.github.com/tokio-rs/tokio/pull/8076 ### [`v1.52.2`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.52.2): Tokio v1.52.2 [Compare Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.52.1...tokio-1.52.2) ### 1.52.2 (May 4th, 2026) This release reverts the LIFO slot stealing change introduced in 1.51.0 ([#​7431]), due to [its performance impact][#​8065]. ([#​8100]) [#​7431]: https://redirect.github.com/tokio-rs/tokio/pull/7431 [#​8065]: https://redirect.github.com/tokio-rs/tokio/pull/8065 [#​8100]: https://redirect.github.com/tokio-rs/tokio/pull/8100
--- ### Configuration πŸ“… **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/DiamondLightSource/numtracker). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee78403..deb4a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -79,7 +79,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -846,7 +846,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -962,7 +962,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -2017,7 +2017,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -2919,7 +2919,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3240,7 +3240,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3573,7 +3573,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3583,7 +3583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3693,9 +3693,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.52.1" +version = "1.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67dee974fe86fd92cc45b7a95fdd2f99a36a6d7b0d431a231178d3d670bbcc6" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" dependencies = [ "bytes", "libc", From 23784815103d89609b18ba72683e7487b1fd2e43 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:34:59 +0000 Subject: [PATCH 03/22] Update Rust crate sqlx to 0.9.0 (#284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [sqlx](https://redirect.github.com/launchbadge/sqlx) | dependencies | minor | `0.8.5` β†’ `0.9.0` | --- ### Release Notes
launchbadge/sqlx (sqlx) ### [`v0.9.0`](https://redirect.github.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#090---2026-05-06) [Compare Source](https://redirect.github.com/launchbadge/sqlx/compare/v0.8.6...v0.9.0) ##### Important Announcements ##### New Github Organization Shortly after this release is published, the SQLx repository will be transferred to a new GitHub organization: This is because SQLx has not been owned or maintained by LaunchBadge, LLC. for a few years now, and has since been informally transferred to the collective ownership of its principal authors. Moving the repository to a new organization makes this change more clear, and also allows for potentially inviting outside collaborators. ##### `Cargo.lock` Removed from Tracking The `Cargo.lock` has been removed from tracking in Git. CI should now always test with the latest versions of all dependencies by default, alongside our pass that checks with `cargo generate-lockfile -Z minimal-versions`. This should eliminate the need for any PRs that update dependencies to also update `Cargo.lock` or contend with an endless stream of merge conflicts against it. **N.B.** `cargo install --locked sqlx-cli` will no longer work. However, `cargo install sqlx-cli` has *always* used the latest dependencies by default, ignoring the lockfile, so most users should not be affected. For users requiring reproducible builds, consider maintaining your own lockfile instead; historically, we only ran `cargo update` sporadically, so relying on SQLx's lockfile offered few guarantees anyway. See [the manual page for `cargo install`][man-cargo-install] for details. ##### Breaking As per our [MSRV policy](FAQ.md#MSRV), the supported Rust version for this release cycle is [`1.94.0`](https://doc.rust-lang.org/stable/releases.html#version-1940-2026-03-05). - \[[#​3383]]: feat: create `sqlx.toml` format \[\[[@​abonander](https://redirect.github.com/abonander)]] - SQLx and `sqlx-cli` now support per-crate configuration files (`sqlx.toml`) - New functionality includes, but is not limited to: - Rename `DATABASE_URL` for a crate (for multi-database workspaces) - Set global type overrides for the macros (supporting custom types) - Rename or relocate the `_sqlx_migrations` table (for multiple crates using the same database) - Set characters to ignore when hashing migrations (e.g. ignore whitespace) - More to be implemented in future releases. - Enable feature `sqlx-toml` to use. - `sqlx-cli` has it enabled by default, but `sqlx` does **not**. - Default features of library crates can be hard to completely turn off because of [feature unification], so it's better to keep the default feature set as limited as possible. [This is something we learned the hard way.][preferred-crates] - Guide: see `sqlx::_config` module in documentation. - Reference: \[[Link](sqlx-core/src/config/reference.toml)] - Examples (written for Postgres but can be adapted to other databases; PRs welcome!): - Multiple databases using `DATABASE_URL` renaming and global type overrides: \[[Link](examples/postgres/multi-database)] - Multi-tenant database using `_sqlx_migrations` renaming and multiple schemas: \[[Link](examples/postgres/multi-tenant)] - Force use of `chrono` when `time` is enabled (e.g. when using `tower-sessions-sqlx-store`): \[[Link][preferred-crates]] - Forcing `bigdecimal` when `rust_decimal` is enabled is also shown, but problems with `chrono`/`time` are more common. - **Breaking changes**: - Significant changes to the `Migrate` trait - `sqlx::migrate::resolve_blocking()` is now `#[doc(hidden)]` and thus SemVer-exempt. - \[[#​3486]]: fix(logs): Correct spelling of aquired\_after\_secs tracing field \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - Breaking behavior change: implementations parsing `tracing` logs from SQLx will need to update the spelling. - \[[#​3495]]: feat(postgres): remove lifetime from `PgAdvisoryLockGuard` \[\[[@​bonsairobo](https://redirect.github.com/bonsairobo)]] - \[[#​3526]]: Return \&mut Self from the migrator set\_ methods \[\[[@​nipunn1313](https://redirect.github.com/nipunn1313)]] - Minor breaking change: `Migrator::set_ignore_missing` and `set_locking` now return `&mut Self` instead of `&Self` which may break code in rare circumstances. - \[[#​3541]]: Postgres: force generic plan for better nullability inference. \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - Breaking change: may alter the output of the `query!()` macros for certain queries in Postgres. - \[[#​3613]]: fix: `RawSql` lifetime issues \[\[[@​abonander](https://redirect.github.com/abonander)]] - Breaking change: adds `DB` type parameter to all methods of `RawSql` - \[[#​3670]]: Bump ipnetwork to v0.21.1 \[\[[@​BeauGieskens](https://redirect.github.com/BeauGieskens)]] - \[[#​3674]]: Implement `Decode`, `Encode` and `Type` for `Box`, `Arc`, `Cow` and `Rc` \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - Breaking change: `impl Decode for Cow` now always decodes `Cow::Owned`, lifetime is unlinked - See this discussion for motivation: [#​3674 (comment)](https://redirect.github.com/launchbadge/sqlx/pull/3674#discussion_r2008611502) - \[[#​3723]]: Add SqlStr \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - Breaking change: all `query*()` functions now take `impl SqlSafeStr` which is only implemented for `&'static str` and `AssertSqlSafe`. For all others, wrap in `AssertSqlSafe()`. - This, along with \[[#​3960]], finally allows returning owned queries as the type will be `Query<'static, DB>`. - `SqlSafeStr` trait is deliberately similar to `std::panic::UnwindSafe`, serving as a speedbump to warn users about naΓ―vely building queries with `format!()` while allowing a workaround for advanced usage that is easy to spot on code review. - \[[#​3800]]: Escape PostgreSQL Options \[\[[@​V02460](https://redirect.github.com/V02460)]] - Breaking behavior change: options passed to `PgConnectOptions::options()` are now automatically escaped. Manual escaping of options is no longer necessary and may cause incorrect behavior. - \[[#​3821]]: Groundwork for 0.9.0-alpha.1 \[\[[@​abonander](https://redirect.github.com/abonander)]] - Increased MSRV to 1.86 and set rust-version - Deleted deprecated combination runtime+TLS features (e.g. `runtime-tokio-native-tls`) - Deleted re-export of unstable `TransactionManager` trait in `sqlx`. - Not technically a breaking change because it's `#[doc(hidden)]`, but [it *will* break SeaORM][seaorm-2600] if not proactively fixed. - \[[#​3924]]: breaking(mysql): assume all non-binary collations compatible with `str` \[\[[@​abonander](https://redirect.github.com/abonander)]] - Text (or text-like) columns which previously were inferred to be `Vec` will be inferred to be `String` (this should ultimately fix more code than it breaks). - `SET NAMES utf8mb4 COLLATE utf8_general_ci` is no longer sent by default; instead, `SET NAMES utf8mb4` is sent to allow the server to select the appropriate default collation (since this is version- and configuration-dependent). - `MySqlConnectOptions::charset()` and `::collation()` now imply `::set_names(true)` because they don't do anything otherwise. - Setting `charset` doesn't change what's sent in the `Protocol::HandshakeResponse41` packet as that normally only matters for error messages before `SET NAMES` is sent. The default collation if `set_names = false` is `utf8mb4_general_ci`. - See [this comment](https://redirect.github.com/launchbadge/sqlx/blob/388c424f486bf20542a8a37d296dbcf86bb6dffd/sqlx-mysql/src/collation.rs#L1-L37) for details. - Incidental breaking change: `RawSql::fetch_optional()` now returns `sqlx::Result>` instead of `sqlx::Result`. Whoops. - \[[#​3928]]: breaking(sqlite): `libsqlite3-sys` versioning, feature flags, safety changes \[\[[@​abonander](https://redirect.github.com/abonander)]] - SemVer policy changes: `libsqlite3-sys` version is now specified using a range. The maximum of the range may now be increased in any backwards-compatible release. The minimum of the range may only be increased in major releases. If you have `libsqlite3-sys` in your dependencies, Cargo should choose a compatible version automatically. If otherwise unconstrained, Cargo should choose the latest version supported. - SQLite extension loading (including through the new `sqlx-toml` feature) is now `unsafe`. - Added new **non-default** features corresponding to conditionally compiled SQLite APIs: - `sqlite-deserialize` enabling `SqliteConnection::serialize()` and `SqliteConnection::deserialize()` - `sqlite-load-extension` enabling `SqliteConnectOptions::extension()` and `::extension_with_entrypoint()` - `sqlite-unlock-notify` enables internal use of `sqlite3_unlock_notify()` - `SqliteValue` and `SqliteValueRef` changes: - The [`sqlite3_value*` interface](https://www.sqlite.org/c3ref/value_blob.html) reserves the right to be stateful. Without protection, any call could theoretically invalidate values previously returned, leading to dangling pointers. - `SqliteValue` is now `!Sync` and `SqliteValueRef` is `!Send` to prevent data races from concurrent accesses. - Instead, clone or wrap the `SqliteValue` in `Mutex`, or convert the `SqliteValueRef` to an owned value. - `SqliteValue` and any derived `SqliteValueRef`s now internally track if that value has been used to decode a borrowed `&[u8]` or `&str` and errors if it's used to decode any other type. - This is not expected to affect the vast majority of usages, which should only decode a single type per `SqliteValue`/`SqliteValueRef`. - See new docs on `SqliteValue` for details. - \[[#​3949]]: Postgres: move `PgLTree::from` to `From>` implementation \[\[[@​JerryQ17](https://redirect.github.com/JerryQ17)]] - \[[#​3957]]: refactor(sqlite): do not borrow bound values, delete lifetime on `SqliteArguments` \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3958]]: refactor(any): Remove lifetime parameter from AnyArguments \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3960]]: refactor(core): Remove lifetime parameter from Arguments trait \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3993]]: Unescape PostgreSQL passfile password \[\[[@​V02460](https://redirect.github.com/V02460)]] - Previously, `.pgpass` file handling did not process backslash-escapes in the password part. Now it does, which may change what password is sent to the server. - \[[#​4008]]: make `#[derive(sqlx::Type)]` automatically generate `impl PgHasArrayType` by default for newtype structs \[\[[@​papaj-na-wrotkach](https://redirect.github.com/papaj-na-wrotkach)]] - Manual implementations of PgHasArrayType for newtypes will conflict with the generated one. Delete the manual impl or add `#[sqlx(no_pg_array)]` where conflicts occur. - \[[#​4077]]: breaking: make `offline` optional to allow building without `serde` \[\[[@​CathalMullan](https://redirect.github.com/CathalMullan)]] - \[[#​4094]]: Bump bit-vec to v0.8 \[\[[@​zennozenith](https://redirect.github.com/zennozenith)]] - \[[#​4142]]: feat(mysql): add mysql-rsa feature for non-TLS RSA auth \[\[[@​dertin](https://redirect.github.com/dertin)]] - Connections requiring RSA password encryption now need to enable the `mysql-rsa` feature or an error will be generated at runtime. RSA encryption is only used for plaintext (non-TLS) connections. - \[[#​4255]]: breaking(any+mysql): correctly convert text and blob types to `AnyTypeInfo` \[\[[@​abonander](https://redirect.github.com/abonander)]] ##### Added - \[[#​3641]]: feat(Postgres): support nested domain types \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3651]]: Add PgBindIter for encoding and use it as the implementation encoding &\[T] \[\[[@​tylerhawkes](https://redirect.github.com/tylerhawkes)]] - \[[#​3675]]: feat: implement Encode, Decode, Type for `Arc` and `Arc<[u8]>` (and `Rc` equivalents) \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3791]]: Smol+async global executor 1.80 dev \[\[[@​martin-kolarik](https://redirect.github.com/martin-kolarik)]] - Adds `runtime-smol` and `runtime-async-global-executor` features to replace usages of the deprecated `async-std` crate. - \[[#​3859]]: Add more JsonRawValue encode/decode impls. \[\[[@​Dirbaio](https://redirect.github.com/Dirbaio)]] - \[[#​3881]]: CLi: made cli-lib modules publicly available for other crates \[\[[@​silvestrpredko](https://redirect.github.com/silvestrpredko)]] - \[[#​3889]]: Compile-time support for external drivers \[\[[@​bobozaur](https://redirect.github.com/bobozaur)]] - \[[#​3917]]: feat(sqlx.toml): support SQLite extensions in macros and sqlx-cli \[\[[@​djarb](https://redirect.github.com/djarb)]] - \[[#​3918]]: Feature: Add exclusion violation error kind \[\[[@​barskern](https://redirect.github.com/barskern)]] - \[[#​3971]]: Allow single-field named structs to be transparent \[\[[@​Xiretza](https://redirect.github.com/Xiretza)]] - \[[#​4015]]: feat(sqlite): `no_tx` migration support \[\[[@​AlexTMjugador](https://redirect.github.com/AlexTMjugador)]] - \[[#​4020]]: Add `Migrator::with_migrations()` constructor \[\[[@​xb284524239](https://redirect.github.com/xb284524239)]] - \[[#​3846]]: Add the possibility to skip migrations \[\[[@​Dosenpfand](https://redirect.github.com/Dosenpfand)]] - \[[#​4107]]: Add SQLite extension entrypoint config to `sqlx.toml`, update SQLite extension example \[\[[@​supleed2](https://redirect.github.com/supleed2)]] - \[[#​4118]]: \[postgres] Display line number in error message \[\[[@​mousetail](https://redirect.github.com/mousetail)]] - \[[#​4123]]: feat: add `Json::into_inner()` \[\[[@​chrxn1c](https://redirect.github.com/chrxn1c)]] - \[[#​4153]]: Add on unimplemented diagnostic to `SqlStr` \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​4167]]: add sqlite serialize/deserialize example \[\[[@​mattrighetti](https://redirect.github.com/mattrighetti)]] - \[[#​4228]]: sqlx-postgres: Make `PgNotification` struct clone \[\[[@​michaelvanstraten](https://redirect.github.com/michaelvanstraten)]] ##### Changed - \[[#​3525]]: Remove unnecessary boxfutures \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3867]]: sqlx-postgres: Bump etcetera to 0.10.0 \[\[[@​miniduikboot](https://redirect.github.com/miniduikboot)]] - \[[#​3709]]: chore: replace once\_cell `OnceCell`/`Lazy` with std `OnceLock`/`LazyLock` \[\[[@​paolobarbolini](https://redirect.github.com/paolobarbolini)]] - \[[#​3890]]: feat: Unify `Debug` implementations across `PgRow`, `MySqlRow` and `SqliteRow` \[\[[@​davidcornu](https://redirect.github.com/davidcornu)]] - \[[#​3911]]: chore: upgrade async-io to v2.4.1 \[\[[@​zebrapurring](https://redirect.github.com/zebrapurring)]] - \[[#​3938]]: Move `QueryLogger` back \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3956]]: chore(sqlite): Remove unused test of removed git2 feature \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3962]]: Give SQLX\_OFFLINE\_DIR from environment precedence in macros \[\[[@​psionic-k](https://redirect.github.com/psionic-k)]] - \[[#​3968]]: chore(ci): Add timeouts to ci jobs \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​4002]]: sqlx-postgres(tests): cleanup 2 unit tests. \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​4022]]: refactor: tweaks after [#​3791](https://redirect.github.com/launchbadge/sqlx/issues/3791) \[\[[@​abonander](https://redirect.github.com/abonander)]] - \[[#​4257]]: Prefer to give real data to `.bind()` in `README.md` \[\[[@​sobolevn](https://redirect.github.com/sobolevn)]] - \[[#​4042]]: Update to webpki-roots 1 \[\[[@​tottoto](https://redirect.github.com/tottoto)]] - \[[#​4072]]: chore: update hashlink to v0.11.0 \[\[[@​anmolitor](https://redirect.github.com/anmolitor)]] - \[[#​4143]]: Bump whoami to v2 \[\[[@​tisonkun](https://redirect.github.com/tisonkun)]] - \[[#​4161]]: sqlx-sqlite: relax libsqlite3-sys constraint to allow 0.36.x \[\[[@​darioAnongba](https://redirect.github.com/darioAnongba)]] - \[[#​4173]]: ci: check direct minimal versions \[\[[@​ricochet](https://redirect.github.com/ricochet)]] - Note: reverted in 0.9.0 release but still listed for contributor credit. See end of PR thread for details. - \[[#​4189]]: Bump flume to 0.12.0 \[\[[@​opoplawski](https://redirect.github.com/opoplawski)]] - \[[#​4223]]: test(sqlite): add regression test for ORDER BY + LIMIT nullability ([#​4147](https://redirect.github.com/launchbadge/sqlx/issues/4147)) \[\[[@​barry3406](https://redirect.github.com/barry3406)]] - \[[#​4230]]: chore: Update to cargo\_metadata 0.23 \[\[[@​tottoto](https://redirect.github.com/tottoto)]] - \[[#​4233]]: Change reference to dotenvy \[\[[@​graemer957](https://redirect.github.com/graemer957)]] - \[[#​4235]]: chore: Update to validator 0.20 \[\[[@​tottoto](https://redirect.github.com/tottoto)]] - \[[#​4253]]: chore: update example to axum 0.8 \[\[[@​tottoto](https://redirect.github.com/tottoto)]] - Release PR: - Upgraded all Rust-Crypto crates, `rand` - Upgraded `etcetera` to `0.11.0` - Increased max of `libsqlite3-sys` version range to `<0.38.0` ##### Fixed - \[[#​3840]]: Fix docs.rs build of sqlx-sqlite \[\[[@​gferon](https://redirect.github.com/gferon)]] - \[[#​3848]]: fix(macros): don't mutate environment variables \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3856]]: fix(macros): slightly improve unsupported type error message \[\[[@​dyc3](https://redirect.github.com/dyc3)]] - \[[#​3857]]: fix(mysql): validate parameter count for prepared statements \[\[[@​cvzx](https://redirect.github.com/cvzx)]] - \[[#​3861]]: Fix NoHostnameTlsVerifier for rustls 0.23.24 and above \[\[[@​elichai](https://redirect.github.com/elichai)]] - \[[#​3863]]: Use unnamed statement in pg when not persistent \[\[[@​ThomWright](https://redirect.github.com/ThomWright)]] - \[[#​3874]]: Further reduce dependency on `futures` and `futures-util` \[\[[@​paolobarbolini](https://redirect.github.com/paolobarbolini)]] - \[[#​3886]]: fix: use Executor::fetch in QueryAs::fetch \[\[[@​bobozaur](https://redirect.github.com/bobozaur)]] - \[[#​3910]]: feat(ok): add correct handling of ok packets in MYSQL implementation \[\[[@​0xfourzerofour](https://redirect.github.com/0xfourzerofour)]] - \[[#​3914]]: fix: regenerate test certificates \[\[[@​abonander](https://redirect.github.com/abonander)]] - \[[#​3915]]: fix: spec\_error is used by try\_from derive \[\[[@​saiintbrisson](https://redirect.github.com/saiintbrisson)]] - \[[#​3919]]: fix\[sqlx-postgres]: do a checked\_mul to prevent panic'ing \[\[[@​nhatcher-frequenz](https://redirect.github.com/nhatcher-frequenz)]] - \[[#​3923]]: sqlx-mysql: Fix bug in cleanup test db's. \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​3950]]: chore: Fix warnings for custom postgres\_## cfg flags \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3952]]: `Pool.close`: close all connections before returning \[\[[@​jpmelos](https://redirect.github.com/jpmelos)]] - \[[#​3975]]: fix documentation for rustls native root certificates \[\[[@​2ndDerivative](https://redirect.github.com/2ndDerivative)]] - \[[#​3977]]: refactor(ci): Use separate job for postgres ssl auth tests \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3980]]: Correctly `ROLLBACK` transaction when dropped during `BEGIN`. \[\[[@​kevincox](https://redirect.github.com/kevincox)]] - \[[#​3981]]: SQLite: fix transaction level accounting with bad custom command. \[\[[@​kevincox](https://redirect.github.com/kevincox)]] - \[[#​3986]]: chore(core): Fix docstring for Query::try\_bind \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3987]]: chore(deps): Resolve deprecation warning for chrono Date and ymd methods \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3988]]: refactor(sqlite): Resolve duplicate test target warning for macros.rs \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3989]]: chore(deps): Set default-features=false on sqlx in workspace.dependencies \[\[[@​iamjpotts](https://redirect.github.com/iamjpotts)]] - \[[#​3991]]: fix(sqlite): regression when decoding nulls \[\[[@​abonander](https://redirect.github.com/abonander)]] - \[[#​4006]]: PostgreSQL SASL – run SHA256 in a blocking executor \[\[[@​ThomWright](https://redirect.github.com/ThomWright)]] - \[[#​4007]]: fix(compose): use OS-assigned ports for all conatiners \[\[[@​papaj-na-wrotkach](https://redirect.github.com/papaj-na-wrotkach)]] - \[[#​4009]]: Drop cached db connections in macros upon hitting an error \[\[[@​swlynch99](https://redirect.github.com/swlynch99)]] - \[[#​4024]]: fix(sqlite) Migrate revert with no-transaction \[\[[@​Dosenpfand](https://redirect.github.com/Dosenpfand)]] - \[[#​4027]]: native tls handshake: build TlsConnector in blocking threadpool \[\[[@​daviduebler](https://redirect.github.com/daviduebler)]] - \[[#​4053]]: fix(macros): smarter `.env` loading, caching, and invalidation \[\[[@​abonander](https://redirect.github.com/abonander)]] - Additional credit to \[\[[@​AlexTMjugador](https://redirect.github.com/AlexTMjugador)]] (\[[#​4018]]) and \[\[[@​Diggsey](https://redirect.github.com/Diggsey)]] (\[[#​4039]]) for their proposed solutions which served as a useful comparison. - \[[#​4068]]: Fix typo in migration example from 'uesrs' to 'users' \[\[[@​squidpickles](https://redirect.github.com/squidpickles)]] - \[[#​4069]]: fix some spelling issues \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​4086]]: fix(mysql): Work around for Issue [#​2206](https://redirect.github.com/launchbadge/sqlx/issues/2206) (ColumnNotFound error when querying) \[\[[@​duelafn](https://redirect.github.com/duelafn)]] - \[[#​4088]]: (Fix) Handle nullability of SQLite rowid alias columns \[\[[@​Lege19](https://redirect.github.com/Lege19)]] - \[[#​4100]]: postgres: update pgpass path on windows \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​4134]]: fix CI: replace removed macOS runner, deprecated use of `Command::cargo_bin()` \[\[[@​abonander](https://redirect.github.com/abonander)]] - \[[#​4136]]: Ensure Deterministic Migration Order \[\[[@​aoengin](https://redirect.github.com/aoengin)]] - \[[#​4158]]: Fix panic in JSONB decoder on invalid version byte \[\[[@​jrey8343](https://redirect.github.com/jrey8343)]] - \[[#​4165]]: sqlx-postgres: fix correct operator precedence in byte length check \[\[[@​cuiweixie](https://redirect.github.com/cuiweixie)]] - \[[#​4171]]: fix(postgres): remove home crate in favor of std::env::home\_dir \[\[[@​ricochet](https://redirect.github.com/ricochet)]] - \[[#​4172]]: fix(sqlx-cli): bump openssl minimum to 0.10.46 \[\[[@​ricochet](https://redirect.github.com/ricochet)]] - \[[#​4176]]: fix(mysql): return error instead of panic on truncated OK packet \[\[[@​cvzx](https://redirect.github.com/cvzx)]] - \[[#​4199]]: fix(postgres): make advisory lock cancel safe \[\[[@​joeydewaal](https://redirect.github.com/joeydewaal)]] - \[[#​4201]]: Fix SCRAM password `SASLprep` \[\[[@​var4yn](https://redirect.github.com/var4yn)]] - \[[#​4202]]: fix: replace from\_utf8\_unchecked with from\_utf8\_lossy in SqliteError \[\[[@​joaquinhuigomez](https://redirect.github.com/joaquinhuigomez)]] - \[[#​4203]]: fix: use sqlite3\_value\_text for REGEXP to match SQLite coercion \[\[[@​joaquinhuigomez](https://redirect.github.com/joaquinhuigomez)]] - \[[#​4219]]: sqlite: lossily coerce invalid UTF-8 in custom collation callback \[\[[@​joaquinhuigomez](https://redirect.github.com/joaquinhuigomez)]] - \[[#​4221]]: fix: replace `from_utf8_unchecked` with `from_utf8` in SQLite column name handling \[\[[@​barry3406](https://redirect.github.com/barry3406)]] - \[[#​4226]]: fix(postgres): use non-prepared statements for metadata queries \[\[[@​abonander](https://redirect.github.com/abonander)]] - \[[#​4227]]: fix(macros-core): update unstable proc\_macro APIs for recent nightly \[\[[@​barry3406](https://redirect.github.com/barry3406)]] - \[[#​4234]]: fix: Use correct path in error when failing to create tmp dir in prepare \[\[[@​Miesvanderlippe](https://redirect.github.com/Miesvanderlippe)]] - \[[#​4245]]: fix(mysql): repair caching\_sha2\_password fast-auth path \[\[[@​altmannmarcelo](https://redirect.github.com/altmannmarcelo)]] - \[[#​4251]]: fix(tls): potential deadlock in `StdSocket::poll_ready()` \[\[[@​abonander](https://redirect.github.com/abonander)]] [seaorm-2600]: https://redirect.github.com/SeaQL/sea-orm/issues/2600 [feature unification]: https://doc.rust-lang.org/cargo/reference/features.html#feature-unification [preferred-crates]: examples/postgres/preferred-crates [man-cargo-install]: https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile [#​3821]: https://redirect.github.com/launchbadge/sqlx/pull/3821 [#​3383]: https://redirect.github.com/launchbadge/sqlx/pull/3383 [#​3486]: https://redirect.github.com/launchbadge/sqlx/pull/3486 [#​3495]: https://redirect.github.com/launchbadge/sqlx/pull/3495 [#​3525]: https://redirect.github.com/launchbadge/sqlx/pull/3525 [#​3526]: https://redirect.github.com/launchbadge/sqlx/pull/3526 [#​3541]: https://redirect.github.com/launchbadge/sqlx/pull/3541 [#​3613]: https://redirect.github.com/launchbadge/sqlx/pull/3613 [#​3641]: https://redirect.github.com/launchbadge/sqlx/pull/3641 [#​3651]: https://redirect.github.com/launchbadge/sqlx/pull/3651 [#​3670]: https://redirect.github.com/launchbadge/sqlx/pull/3670 [#​3674]: https://redirect.github.com/launchbadge/sqlx/pull/3674 [#​3675]: https://redirect.github.com/launchbadge/sqlx/pull/3675 [#​3709]: https://redirect.github.com/launchbadge/sqlx/pull/3709 [#​3723]: https://redirect.github.com/launchbadge/sqlx/pull/3723 [#​3791]: https://redirect.github.com/launchbadge/sqlx/pull/3791 [#​3800]: https://redirect.github.com/launchbadge/sqlx/pull/3800 [#​3821]: https://redirect.github.com/launchbadge/sqlx/pull/3821 [#​3840]: https://redirect.github.com/launchbadge/sqlx/pull/3840 [#​3848]: https://redirect.github.com/launchbadge/sqlx/pull/3848 [#​3856]: https://redirect.github.com/launchbadge/sqlx/pull/3856 [#​3857]: https://redirect.github.com/launchbadge/sqlx/pull/3857 [#​3859]: https://redirect.github.com/launchbadge/sqlx/pull/3859 [#​3861]: https://redirect.github.com/launchbadge/sqlx/pull/3861 [#​3863]: https://redirect.github.com/launchbadge/sqlx/pull/3863 [#​3867]: https://redirect.github.com/launchbadge/sqlx/pull/3867 [#​3874]: https://redirect.github.com/launchbadge/sqlx/pull/3874 [#​3881]: https://redirect.github.com/launchbadge/sqlx/pull/3881 [#​3886]: https://redirect.github.com/launchbadge/sqlx/pull/3886 [#​3889]: https://redirect.github.com/launchbadge/sqlx/pull/3889 [#​3890]: https://redirect.github.com/launchbadge/sqlx/pull/3890 [#​3910]: https://redirect.github.com/launchbadge/sqlx/pull/3910 [#​3911]: https://redirect.github.com/launchbadge/sqlx/pull/3911 [#​3914]: https://redirect.github.com/launchbadge/sqlx/pull/3914 [#​3915]: https://redirect.github.com/launchbadge/sqlx/pull/3915 [#​3917]: https://redirect.github.com/launchbadge/sqlx/pull/3917 [#​3918]: https://redirect.github.com/launchbadge/sqlx/pull/3918 [#​3919]: https://redirect.github.com/launchbadge/sqlx/pull/3919 [#​3923]: https://redirect.github.com/launchbadge/sqlx/pull/3923 [#​3924]: https://redirect.github.com/launchbadge/sqlx/pull/3924 [#​3928]: https://redirect.github.com/launchbadge/sqlx/pull/3928 [#​3938]: https://redirect.github.com/launchbadge/sqlx/pull/3938 [#​3949]: https://redirect.github.com/launchbadge/sqlx/pull/3949 [#​3950]: https://redirect.github.com/launchbadge/sqlx/pull/3950 [#​3952]: https://redirect.github.com/launchbadge/sqlx/pull/3952 [#​3956]: https://redirect.github.com/launchbadge/sqlx/pull/3956 [#​3957]: https://redirect.github.com/launchbadge/sqlx/pull/3957 [#​3958]: https://redirect.github.com/launchbadge/sqlx/pull/3958 [#​3960]: https://redirect.github.com/launchbadge/sqlx/pull/3960 [#​3962]: https://redirect.github.com/launchbadge/sqlx/pull/3962 [#​3968]: https://redirect.github.com/launchbadge/sqlx/pull/3968 [#​3971]: https://redirect.github.com/launchbadge/sqlx/pull/3971 [#​3975]: https://redirect.github.com/launchbadge/sqlx/pull/3975 [#​3977]: https://redirect.github.com/launchbadge/sqlx/pull/3977 [#​3980]: https://redirect.github.com/launchbadge/sqlx/pull/3980 [#​3981]: https://redirect.github.com/launchbadge/sqlx/pull/3981 [#​3986]: https://redirect.github.com/launchbadge/sqlx/pull/3986 [#​3987]: https://redirect.github.com/launchbadge/sqlx/pull/3987 [#​3988]: https://redirect.github.com/launchbadge/sqlx/pull/3988 [#​3989]: https://redirect.github.com/launchbadge/sqlx/pull/3989 [#​3991]: https://redirect.github.com/launchbadge/sqlx/pull/3991 [#​4002]: https://redirect.github.com/launchbadge/sqlx/pull/4002 [#​4006]: https://redirect.github.com/launchbadge/sqlx/pull/4006 [#​4007]: https://redirect.github.com/launchbadge/sqlx/pull/4007 [#​4008]: https://redirect.github.com/launchbadge/sqlx/pull/4008 [#​4009]: https://redirect.github.com/launchbadge/sqlx/pull/4009 [#​4015]: https://redirect.github.com/launchbadge/sqlx/pull/4015 [#​4018]: https://redirect.github.com/launchbadge/sqlx/pull/4018 [#​4020]: https://redirect.github.com/launchbadge/sqlx/pull/4020 [#​4022]: https://redirect.github.com/launchbadge/sqlx/pull/4022 [#​4024]: https://redirect.github.com/launchbadge/sqlx/pull/4024 [#​4027]: https://redirect.github.com/launchbadge/sqlx/pull/4027 [#​4039]: https://redirect.github.com/launchbadge/sqlx/pull/4039 [#​4053]: https://redirect.github.com/launchbadge/sqlx/pull/4053 [#​3846]: https://redirect.github.com/launchbadge/sqlx/pull/3846 [#​3993]: https://redirect.github.com/launchbadge/sqlx/pull/3993 [#​4042]: https://redirect.github.com/launchbadge/sqlx/pull/4042 [#​4068]: https://redirect.github.com/launchbadge/sqlx/pull/4068 [#​4069]: https://redirect.github.com/launchbadge/sqlx/pull/4069 [#​4072]: https://redirect.github.com/launchbadge/sqlx/pull/4072 [#​4077]: https://redirect.github.com/launchbadge/sqlx/pull/4077 [#​4086]: https://redirect.github.com/launchbadge/sqlx/pull/4086 [#​4088]: https://redirect.github.com/launchbadge/sqlx/pull/4088 [#​4094]: https://redirect.github.com/launchbadge/sqlx/pull/4094 [#​4100]: https://redirect.github.com/launchbadge/sqlx/pull/4100 [#​4107]: https://redirect.github.com/launchbadge/sqlx/pull/4107 [#​4118]: https://redirect.github.com/launchbadge/sqlx/pull/4118 [#​4123]: https://redirect.github.com/launchbadge/sqlx/pull/4123 [#​4134]: https://redirect.github.com/launchbadge/sqlx/pull/4134 [#​4136]: https://redirect.github.com/launchbadge/sqlx/pull/4136 [#​4142]: https://redirect.github.com/launchbadge/sqlx/pull/4142 [#​4143]: https://redirect.github.com/launchbadge/sqlx/pull/4143 [#​4153]: https://redirect.github.com/launchbadge/sqlx/pull/4153 [#​4158]: https://redirect.github.com/launchbadge/sqlx/pull/4158 [#​4161]: https://redirect.github.com/launchbadge/sqlx/pull/4161 [#​4165]: https://redirect.github.com/launchbadge/sqlx/pull/4165 [#​4167]: https://redirect.github.com/launchbadge/sqlx/pull/4167 [#​4171]: https://redirect.github.com/launchbadge/sqlx/pull/4171 [#​4172]: https://redirect.github.com/launchbadge/sqlx/pull/4172 [#​4173]: https://redirect.github.com/launchbadge/sqlx/pull/4173 [#​4176]: https://redirect.github.com/launchbadge/sqlx/pull/4176 [#​4189]: https://redirect.github.com/launchbadge/sqlx/pull/4189 [#​4199]: https://redirect.github.com/launchbadge/sqlx/pull/4199 [#​4201]: https://redirect.github.com/launchbadge/sqlx/pull/4201 [#​4202]: https://redirect.github.com/launchbadge/sqlx/pull/4202 [#​4203]: https://redirect.github.com/launchbadge/sqlx/pull/4203 [#​4219]: https://redirect.github.com/launchbadge/sqlx/pull/4219 [#​4221]: https://redirect.github.com/launchbadge/sqlx/pull/4221 [#​4223]: https://redirect.github.com/launchbadge/sqlx/pull/4223 [#​4226]: https://redirect.github.com/launchbadge/sqlx/pull/4226 [#​4227]: https://redirect.github.com/launchbadge/sqlx/pull/4227 [#​4228]: https://redirect.github.com/launchbadge/sqlx/pull/4228 [#​4230]: https://redirect.github.com/launchbadge/sqlx/pull/4230 [#​4233]: https://redirect.github.com/launchbadge/sqlx/pull/4233 [#​4234]: https://redirect.github.com/launchbadge/sqlx/pull/4234 [#​4235]: https://redirect.github.com/launchbadge/sqlx/pull/4235 [#​4245]: https://redirect.github.com/launchbadge/sqlx/pull/4245 [#​4251]: https://redirect.github.com/launchbadge/sqlx/pull/4251 [#​4253]: https://redirect.github.com/launchbadge/sqlx/pull/4253 [#​4255]: https://redirect.github.com/launchbadge/sqlx/pull/4255 [#​4257]: https://redirect.github.com/launchbadge/sqlx/pull/4257
--- ### Configuration πŸ“… **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/DiamondLightSource/numtracker). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Peter Holloway --- ...0cd3f81e49b4836604e2d040c09aba1b590b0.json | 56 ++- ...e2bf1cf90adca88506b4c484f4f6234463200.json | 56 ++- ...98cf755078ddff46bdc3b6c0074d4cc885a1f.json | 56 ++- ...5d87a0a44be3838754fe180d9e724722af52f.json | 56 ++- Cargo.lock | 413 ++++++++++-------- Cargo.toml | 2 +- src/db_service.rs | 2 +- 7 files changed, 417 insertions(+), 224 deletions(-) diff --git a/.sqlx/query-30e7b9868a569ff84bf63ad3f750cd3f81e49b4836604e2d040c09aba1b590b0.json b/.sqlx/query-30e7b9868a569ff84bf63ad3f750cd3f81e49b4836604e2d040c09aba1b590b0.json index 552e0d9..ad148f5 100644 --- a/.sqlx/query-30e7b9868a569ff84bf63ad3f750cd3f81e49b4836604e2d040c09aba1b590b0.json +++ b/.sqlx/query-30e7b9868a569ff84bf63ad3f750cd3f81e49b4836604e2d040c09aba1b590b0.json @@ -6,37 +6,79 @@ { "name": "id", "ordinal": 0, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "id" + } + } }, { "name": "name", "ordinal": 1, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "name" + } + } }, { "name": "scan_number", "ordinal": 2, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "scan_number" + } + } }, { "name": "directory", "ordinal": 3, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "directory" + } + } }, { "name": "scan", "ordinal": 4, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "scan" + } + } }, { "name": "detector", "ordinal": 5, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "detector" + } + } }, { "name": "tracker_file_extension", "ordinal": 6, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "tracker_file_extension" + } + } } ], "parameters": { diff --git a/.sqlx/query-6d1e14903687dc07c77d9dbc0e2e2bf1cf90adca88506b4c484f4f6234463200.json b/.sqlx/query-6d1e14903687dc07c77d9dbc0e2e2bf1cf90adca88506b4c484f4f6234463200.json index 562cb1a..4b84f30 100644 --- a/.sqlx/query-6d1e14903687dc07c77d9dbc0e2e2bf1cf90adca88506b4c484f4f6234463200.json +++ b/.sqlx/query-6d1e14903687dc07c77d9dbc0e2e2bf1cf90adca88506b4c484f4f6234463200.json @@ -6,37 +6,79 @@ { "name": "id", "ordinal": 0, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "id" + } + } }, { "name": "name", "ordinal": 1, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "name" + } + } }, { "name": "scan_number", "ordinal": 2, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "scan_number" + } + } }, { "name": "directory", "ordinal": 3, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "directory" + } + } }, { "name": "scan", "ordinal": 4, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "scan" + } + } }, { "name": "detector", "ordinal": 5, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "detector" + } + } }, { "name": "tracker_file_extension", "ordinal": 6, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "tracker_file_extension" + } + } } ], "parameters": { diff --git a/.sqlx/query-732d78dd385205d3a4f4b2f71dc98cf755078ddff46bdc3b6c0074d4cc885a1f.json b/.sqlx/query-732d78dd385205d3a4f4b2f71dc98cf755078ddff46bdc3b6c0074d4cc885a1f.json index 8c6d7df..8a01343 100644 --- a/.sqlx/query-732d78dd385205d3a4f4b2f71dc98cf755078ddff46bdc3b6c0074d4cc885a1f.json +++ b/.sqlx/query-732d78dd385205d3a4f4b2f71dc98cf755078ddff46bdc3b6c0074d4cc885a1f.json @@ -6,37 +6,79 @@ { "name": "id", "ordinal": 0, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "id" + } + } }, { "name": "name", "ordinal": 1, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "name" + } + } }, { "name": "scan_number", "ordinal": 2, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "scan_number" + } + } }, { "name": "directory", "ordinal": 3, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "directory" + } + } }, { "name": "scan", "ordinal": 4, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "scan" + } + } }, { "name": "detector", "ordinal": 5, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "detector" + } + } }, { "name": "tracker_file_extension", "ordinal": 6, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "tracker_file_extension" + } + } } ], "parameters": { diff --git a/.sqlx/query-99bf4cc482254ce2a89496c99e65d87a0a44be3838754fe180d9e724722af52f.json b/.sqlx/query-99bf4cc482254ce2a89496c99e65d87a0a44be3838754fe180d9e724722af52f.json index 8bcae0a..8f8e669 100644 --- a/.sqlx/query-99bf4cc482254ce2a89496c99e65d87a0a44be3838754fe180d9e724722af52f.json +++ b/.sqlx/query-99bf4cc482254ce2a89496c99e65d87a0a44be3838754fe180d9e724722af52f.json @@ -6,37 +6,79 @@ { "name": "id", "ordinal": 0, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "id" + } + } }, { "name": "name", "ordinal": 1, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "name" + } + } }, { "name": "scan_number", "ordinal": 2, - "type_info": "Integer" + "type_info": "Integer", + "origin": { + "Table": { + "table": "instrument", + "name": "scan_number" + } + } }, { "name": "directory", "ordinal": 3, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "directory" + } + } }, { "name": "scan", "ordinal": 4, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "scan" + } + } }, { "name": "detector", "ordinal": 5, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "detector" + } + } }, { "name": "tracker_file_extension", "ordinal": 6, - "type_info": "Text" + "type_info": "Text", + "origin": { + "Table": { + "table": "instrument", + "name": "tracker_file_extension" + } + } } ], "parameters": { diff --git a/Cargo.lock b/Cargo.lock index deb4a08..7065352 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -79,7 +79,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -329,7 +329,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sha1", + "sha1 0.10.6", "sync_wrapper", "tokio", "tokio-tungstenite", @@ -422,6 +422,15 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-buffer" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + [[package]] name = "built" version = "0.8.0" @@ -477,6 +486,17 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", +] + [[package]] name = "chrono" version = "0.4.44" @@ -532,6 +552,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + [[package]] name = "colorchoice" version = "1.0.5" @@ -587,6 +613,15 @@ dependencies = [ "libc", ] +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "crc" version = "3.4.0" @@ -639,6 +674,24 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-common" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -646,9 +699,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "curve25519-dalek-derive", - "digest", + "digest 0.10.7", "fiat-crypto", "rustc_version", "subtle", @@ -822,12 +875,23 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer", + "block-buffer 0.10.4", "const-oid", - "crypto-common", + "crypto-common 0.1.6", "subtle", ] +[[package]] +name = "digest" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" +dependencies = [ + "block-buffer 0.12.1", + "crypto-common 0.2.2", + "ctutils", +] + [[package]] name = "dirs" version = "6.0.0" @@ -846,7 +910,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -879,7 +943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", - "digest", + "digest 0.10.7", "elliptic-curve", "rfc6979", "signature", @@ -905,7 +969,7 @@ dependencies = [ "curve25519-dalek", "ed25519", "serde", - "sha2", + "sha2 0.10.9", "subtle", "zeroize", ] @@ -927,11 +991,11 @@ checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", - "digest", + "digest 0.10.7", "ff", "generic-array", "group", - "hkdf", + "hkdf 0.12.4", "pem-rfc7468", "pkcs8", "rand_core 0.6.4", @@ -962,18 +1026,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "etcetera" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +checksum = "de48cc4d1c1d97a20fd819def54b890cadde72ed3ad0c614822a0a433361be96" dependencies = [ "cfg-if", - "home", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] @@ -1036,9 +1099,9 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "flume" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +checksum = "5e139bc46ca777eb5efaf62df0ab8cc5fd400866427e56c68b22e414e53bd3be" dependencies = [ "futures-core", "futures-sink", @@ -1057,6 +1120,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" version = "1.2.2" @@ -1228,6 +1297,7 @@ dependencies = [ "cfg-if", "libc", "r-efi 6.0.0", + "rand_core 0.10.1", "wasip2", "wasip3", ] @@ -1365,10 +1435,19 @@ name = "hashbrown" version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.2.0", ] [[package]] @@ -1379,11 +1458,11 @@ checksum = "4f467dd6dccf739c208452f8014c75c18bb8301b050ad1cfb27153803edb0f51" [[package]] name = "hashlink" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +checksum = "824e001ac4f3012dd16a264bec811403a67ca9deb6c102fc5049b32c4574b35f" dependencies = [ - "hashbrown 0.15.5", + "hashbrown 0.16.1", ] [[package]] @@ -1398,7 +1477,7 @@ dependencies = [ "http", "httpdate", "mime", - "sha1", + "sha1 0.10.6", ] [[package]] @@ -1434,7 +1513,16 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac", + "hmac 0.12.1", +] + +[[package]] +name = "hkdf" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4aaa26c720c68b866f2c96ef5c1264b3e6f473fe5d4ce61cd44bbe913e553018" +dependencies = [ + "hmac 0.13.0", ] [[package]] @@ -1443,16 +1531,16 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest", + "digest 0.10.7", ] [[package]] -name = "home" -version = "0.5.12" +name = "hmac" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc627f471c528ff0c4a49e1d5e60450c8f6461dd6d10ba9dcd3a61d3dff7728d" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" dependencies = [ - "windows-sys 0.61.2", + "digest 0.11.3", ] [[package]] @@ -1544,6 +1632,15 @@ dependencies = [ "url", ] +[[package]] +name = "hybrid-array" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b" +dependencies = [ + "typenum", +] + [[package]] name = "hyper" version = "1.9.0" @@ -1884,10 +1981,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e02f3bb43d335493c96bf3fd3a321600bf6bd07ed34bc64118e9293bdffea46c" dependencies = [ - "bitflags", "libc", - "plain", - "redox_syscall 0.7.4", ] [[package]] @@ -1963,12 +2057,12 @@ checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "md-5" -version = "0.10.6" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "69b6441f590336821bb897fb28fc622898ccceb1d6cea3fde5ea86b090c4de98" dependencies = [ "cfg-if", - "digest", + "digest 0.11.3", ] [[package]] @@ -2017,7 +2111,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2131,7 +2225,7 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51e219e79014df21a225b1860a479e2dcd7cbd9130f4defd4bd0e191ea31d67d" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "chrono", "getrandom 0.2.17", "http", @@ -2140,7 +2234,7 @@ dependencies = [ "serde", "serde_json", "serde_path_to_error", - "sha2", + "sha2 0.10.9", "thiserror 1.0.69", "url", ] @@ -2167,7 +2261,7 @@ dependencies = [ "chrono", "dyn-clone", "ed25519-dalek", - "hmac", + "hmac 0.12.1", "http", "itertools", "log", @@ -2182,7 +2276,7 @@ dependencies = [ "serde_path_to_error", "serde_plain", "serde_with", - "sha2", + "sha2 0.10.9", "subtle", "thiserror 1.0.69", "url", @@ -2294,7 +2388,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2", + "sha2 0.10.9", ] [[package]] @@ -2306,7 +2400,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2", + "sha2 0.10.9", ] [[package]] @@ -2333,7 +2427,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.18", + "redox_syscall", "smallvec", "windows-link", ] @@ -2402,7 +2496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89815c69d36021a140146f26659a81d6c2afa33d216d736dd4be5381a7362220" dependencies = [ "pest", - "sha2", + "sha2 0.10.9", ] [[package]] @@ -2458,12 +2552,6 @@ version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - [[package]] name = "polling" version = "3.11.0" @@ -2659,6 +2747,17 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.2", + "rand_core 0.10.1", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -2698,19 +2797,16 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.5.18" +name = "rand_core" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" -dependencies = [ - "bitflags", -] +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "redox_syscall" -version = "0.7.4" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f450ad9c3b1da563fb6948a8e0fb0fb9269711c9c73d9ea1de5058c79c8d643a" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ "bitflags", ] @@ -2827,7 +2923,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] @@ -2852,7 +2948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8573f03f5883dcaebdfcf4725caa1ecb9c15b2ef50c43a07b816e06799bb12d" dependencies = [ "const-oid", - "digest", + "digest 0.10.7", "num-bigint-dig", "num-integer", "num-traits", @@ -2919,7 +3015,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3162,8 +3258,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", - "cpufeatures", - "digest", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha1" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aacc4cc499359472b4abe1bf11d0b12e688af9a805fa5e3016f9a386dc2d0214" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", ] [[package]] @@ -3173,8 +3280,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", - "cpufeatures", - "digest", + "cpufeatures 0.2.17", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", ] [[package]] @@ -3208,7 +3326,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest", + "digest 0.10.7", "rand_core 0.6.4", ] @@ -3240,7 +3358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3264,9 +3382,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" +checksum = "378620ccc25c62c89d8be1c819e76a88d59bdcc3304733330788948e619bfd71" dependencies = [ "sqlx-core", "sqlx-macros", @@ -3277,12 +3395,13 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" +checksum = "05b44e85bf579a8eeb4ceaa77a3a523baf2bf0e9bac7e40f405d537b5d2d5ccb" dependencies = [ "base64 0.22.1", "bytes", + "cfg-if", "crc", "crossbeam-queue", "either", @@ -3291,16 +3410,15 @@ dependencies = [ "futures-intrusive", "futures-io", "futures-util", - "hashbrown 0.15.5", + "hashbrown 0.16.1", "hashlink", "indexmap 2.14.0", "log", "memchr", - "once_cell", "percent-encoding", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "smallvec", "thiserror 2.0.18", "tokio", @@ -3311,9 +3429,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" +checksum = "bd2b84f2bc39a5705ef27ec785a11c934a41bbd4a24941e257927cddc26b60bf" dependencies = [ "proc-macro2", "quote", @@ -3324,76 +3442,61 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" +checksum = "fb8d96de5fdc85a5c4ec813432b523ec637e80ba98f046555f75f7908ddac7c3" dependencies = [ + "cfg-if", "dotenvy", "either", "heck", "hex", - "once_cell", "proc-macro2", "quote", "serde", "serde_json", - "sha2", + "sha2 0.10.9", "sqlx-core", "sqlx-mysql", "sqlx-postgres", "sqlx-sqlite", "syn 2.0.117", + "thiserror 2.0.18", "tokio", "url", ] [[package]] name = "sqlx-mysql" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" +checksum = "90b8020fe17c5f2c245bfa2505d7ef59c5604839527c740266ad2214acebea27" dependencies = [ - "atoi", - "base64 0.22.1", "bitflags", "byteorder", "bytes", "crc", - "digest", + "digest 0.11.3", "dotenvy", "either", - "futures-channel", "futures-core", - "futures-io", "futures-util", "generic-array", - "hex", - "hkdf", - "hmac", - "itoa", "log", - "md-5", - "memchr", - "once_cell", "percent-encoding", - "rand 0.8.6", - "rsa", "serde", - "sha1", - "sha2", - "smallvec", + "sha1 0.11.0", + "sha2 0.11.0", "sqlx-core", - "stringprep", "thiserror 2.0.18", "tracing", - "whoami", ] [[package]] name = "sqlx-postgres" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" +checksum = "87a2bdd6e83f6b3ea525ca9fee568030508b58355a43d0b2c1674d5f79dcd65e" dependencies = [ "atoi", "base64 0.22.1", @@ -3406,18 +3509,16 @@ dependencies = [ "futures-core", "futures-util", "hex", - "hkdf", - "hmac", - "home", + "hkdf 0.13.0", + "hmac 0.13.0", "itoa", "log", "md-5", "memchr", - "once_cell", - "rand 0.8.6", + "rand 0.10.2", "serde", "serde_json", - "sha2", + "sha2 0.11.0", "smallvec", "sqlx-core", "stringprep", @@ -3428,12 +3529,13 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.6" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" +checksum = "488e99c397a62007e4229aec669a179816339afc6d2620ca6fa420dbee2e982c" dependencies = [ "atoi", "flume", + "form_urlencoded", "futures-channel", "futures-core", "futures-executor", @@ -3443,7 +3545,6 @@ dependencies = [ "log", "percent-encoding", "serde", - "serde_urlencoded", "sqlx-core", "thiserror 2.0.18", "tracing", @@ -3573,7 +3674,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -3583,7 +3684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -4030,7 +4131,7 @@ dependencies = [ "httparse", "log", "rand 0.9.4", - "sha1", + "sha1 0.10.6", "thiserror 2.0.18", ] @@ -4173,12 +4274,6 @@ dependencies = [ "wit-bindgen 0.51.0", ] -[[package]] -name = "wasite" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" - [[package]] name = "wasm-bindgen" version = "0.2.118" @@ -4299,13 +4394,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.6.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4a4db5077702ca3015d3d02d74974948aba2ad9e12ab7df718ee64ccd7e97d" -dependencies = [ - "libredox", - "wasite", -] +checksum = "626c4bac6755d76ffc12cb01b2eac751db1996b9e0041de9aa02c8c211ddc82c" [[package]] name = "windows-core" @@ -4366,15 +4457,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -4402,21 +4484,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -4450,12 +4517,6 @@ dependencies = [ "windows_x86_64_msvc 0.53.1", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -4468,12 +4529,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -4486,12 +4541,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -4516,12 +4565,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -4534,12 +4577,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -4552,12 +4589,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -4570,12 +4601,6 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" diff --git a/Cargo.toml b/Cargo.toml index 63440f7..105cfe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ opentelemetry-semantic-conventions = "0.31.0" opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] } reqwest = { version = "0.12.15", features = ["json", "rustls-tls"], default-features = false } serde = { version = "1.0.219", features = ["derive"] } -sqlx = { version = "0.8.5", features = ["runtime-tokio", "sqlite"] } +sqlx = { version = "0.9.0", features = ["runtime-tokio", "sqlite"] } tokio = { version = "1.45.0", features = ["full"] } tracing = "0.1.41" tracing-opentelemetry = "0.32.0" diff --git a/src/db_service.rs b/src/db_service.rs index 0445014..c1eaa51 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -172,7 +172,7 @@ impl InstrumentConfigurationUpdate { trace!( instrument = self.name, - query = q.sql(), + query = q.sql().as_str(), "Updating instrument configuration", ); From 9141e47f64127579e982c089d54fc23427f7ab3f Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:36:48 +0000 Subject: [PATCH 04/22] Update rust Docker tag to v1.98.0 (#285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rust](https://hub.docker.com/_/rust) ([source](https://redirect.github.com/rust-lang/docker-rust)) | final | minor | `1.95.0-slim` β†’ `1.98.0-slim` | --- ### Configuration πŸ“… **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. πŸ”• **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/DiamondLightSource/numtracker). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 718f450..6bb0e13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.95.0-slim AS build +FROM rust:1.98.0-slim AS build RUN rustup target add x86_64-unknown-linux-musl && \ apt-get update && \ From 227cf7c28986bd17a131cf24dcb42189e6c8ada4 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:19:01 +0000 Subject: [PATCH 05/22] Update tracing and telemetry (#282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [opentelemetry](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry) ([source](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/HEAD/opentelemetry)) | dependencies | minor | `0.31.0` β†’ `0.32.0` | | [opentelemetry-otlp](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-otlp) ([source](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/HEAD/opentelemetry-otlp)) | dependencies | minor | `0.31.0` β†’ `0.32.0` | | [opentelemetry-semantic-conventions](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry-semantic-conventions) ([source](https://redirect.github.com/open-telemetry/opentelemetry-rust/tree/HEAD/opentelemetry-semantic-conventions)) | dependencies | minor | `0.31.0` β†’ `0.32.0` | | [tracing-opentelemetry](https://redirect.github.com/tokio-rs/tracing-opentelemetry) | dependencies | minor | `0.32.0` β†’ `0.33.0` | --- ### Release Notes
open-telemetry/opentelemetry-rust (opentelemetry) ### [`v0.32.0`](https://redirect.github.com/open-telemetry/opentelemetry-rust/blob/HEAD/opentelemetry/CHANGELOG.md#0320) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-rust/compare/v0.31.0...opentelemetry-0.32.0) Released 2026-May-08 - **Added** `BoundCounter` and `BoundHistogram` types that cache resolved aggregator references for a fixed attribute set. Created via `Counter::bind()` and `Histogram::bind()`, bound instruments bypass per-call attribute lookup, providing significant performance improvements for hot paths where the same attributes are used repeatedly. Both types implement `Clone` so a single bound state can be shared across threads or modules without re-binding. Also adds the `SyncInstrument::bind()` trait method and `BoundSyncInstrument` trait for SDK implementors; the trait method has a no-op default so custom `SyncInstrument` impls degrade gracefully without panicking. Gated behind the `experimental_metrics_bound_instruments` feature flag. - Add `reserve` method to `opentelemetry::propagation::Injector` to hint at the number of elements that will be added to avoid multiple resize operations of the underlying data structure. Has an empty default implementation. - **Breaking** Removed the following public fields and methods from the `SpanBuilder` [#​3227][3227]: - `trace_id`, `span_id`, `end_time`, `status`, `sampling_result` - `with_trace_id`, `with_span_id`, `with_end_time`, `with_status`, `with_sampling_result` - **Added** `#[must_use]` attribute to `opentelemetry::metrics::AsyncInstrumentBuilder` to add compile time warning when `.build()` is not called on observable instrument builders, preventing silent failures where callbacks are never registered and metrics are never reported. - **Breaking** Moved the following SDK sampling types from `opentelemetry::trace` to `opentelemetry_sdk::trace` [#​3277][3277]: - `SamplingDecision`, `SamplingResult` - These types are SDK implementation details and should be imported from `opentelemetry_sdk::trace` instead. - "spec\_unstable\_logs\_enabled" feature flag is removed. The capability (and the backing specification) is now stable and is enabled by default. [3278](https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3278) - Remove the empty "message" field from `tracing` events emitted via the `internal-logs` feature - Fix panic when calling `Context::current()` from `Drop` implementations triggered by `ContextGuard` cleanup ([#​3262][3262]). [3227]: https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3227 [3262]: https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3262 [3277]: https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3277
open-telemetry/opentelemetry-rust (opentelemetry-otlp) ### [`v0.32.0`](https://redirect.github.com/open-telemetry/opentelemetry-rust/blob/HEAD/opentelemetry-otlp/CHANGELOG.md#0320) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-rust/compare/opentelemetry-otlp-0.31.1...opentelemetry-otlp-0.32.0) Released 2026-May-08 - Add `tls-provider-agnostic` feature flag for environments that require a custom crypto backend (e.g., OpenSSL for FIPS compliance). Enables TLS code paths without bundling `ring` or `aws-lc-rs`. - Add `build()` directly on `SpanExporterBuilder`, `MetricExporterBuilder`, and `LogExporterBuilder` (before selecting a transport), which auto-selects the transport based on the `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable or enabled features. [#​3394](https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3394) - **Breaking** Removed `ExportConfig`, `HasExportConfig`, `with_export_config()`, `HasTonicConfig`, `HasHttpConfig`, `TonicConfig`, and `HttpConfig` from public API. Use the public `WithExportConfig`, `WithTonicConfig`, and `WithHttpConfig` trait methods instead, which remain unchanged. - The gRPC/tonic OTLP exporter's build method now returns an error for all signals (traces, metrics, logs) when an `https://` endpoint is configured but no TLS feature (`tls-ring` or `tls-aws-lc`) is enabled, instead of silently sending unencrypted traffic. When a TLS feature is enabled and an `https://` endpoint is used without an explicit `.with_tls_config()`, a default `ClientTlsConfig` is automatically applied. [#​3182](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/3182) - Prevent auth tokens from leaking in export error messages. gRPC and HTTP exporter errors no longer include potentially sensitive server responses (e.g., authentication tokens echoed back). Error messages returned to SDK processors contain only the gRPC status code or HTTP status code. Full details are logged at DEBUG level only. [#​3021](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/3021) - Surface pre-flight transport error details at ERROR level when `grpc-tonic` OTLP export fails due to a local misconfiguration. When the returned `tonic::Status` wraps a local transport error (invalid URL, connect failure, DNS), its source chain (e.g., `"transport error: invalid URI"`) is appended to the returned error so SDK processors surface it at ERROR without requiring DEBUG logging. Server-returned gRPC status messages remain DEBUG-only to preserve the auth-token leak safeguards from [#​3021](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/3021). [#​3331](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/3331) - Add support for per-signal protocol environment variables: `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL`, `OTEL_EXPORTER_OTLP_METRICS_PROTOCOL`, `OTEL_EXPORTER_OTLP_LOGS_PROTOCOL`. These allow configuring different transport protocols per signal type. Signal-specific vars take precedence over generic `OTEL_EXPORTER_OTLP_PROTOCOL`. The auto-select `build()` method on each exporter builder now respects the full priority chain: signal-specific env var > generic env var > feature-based default. - Transport/protocol mismatch validation: HTTP transport returns `InvalidConfig` when gRPC protocol is requested; gRPC transport returns `InvalidConfig` when an HTTP protocol is requested. - **Breaking**: `Protocol::default()` no longer consults the `OTEL_EXPORTER_OTLP_PROTOCOL` environment variable. It now returns only the feature-based default (http-json > http-proto > grpc-tonic). Protocol resolution from environment variables is handled internally by the exporter builders. Users who relied on `Protocol::default()` to read env vars should use `Protocol::from_env()` instead. - Add support for `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` environment variable to configure metrics temporality. Accepted values: `cumulative` (default), `delta`, `lowmemory` (case-insensitive). Programmatic `.with_temporality()` overrides the env var. - Fix `NoHttpClient` error when multiple HTTP client features are enabled by using priority-based selection (`reqwest-client` > `hyper-client` > `reqwest-blocking-client`). [#​2994](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/2994) - Add partial success response handling for OTLP exporters (traces, metrics, logs) per OTLP spec. Exporters now log warnings when the server returns partial success responses with rejected items and error messages. [#​865](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/865) - Refactor `internal-logs` feature in `opentelemetry-otlp` to reduce unnecessary dependencies[3191](https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3192) - Fixed \[[#​2777](https://redirect.github.com/open-telemetry/opentelemetry-rust/issues/2777)]\( rust/issues/2777) to properly handle `shutdown_with_timeout()` when using `grpc-tonic`. - Deprecate `tls` feature in favor of explicit `tls-ring` and `tls-aws-lc` features. **Migration**: Replace `tls` with `tls-ring` (or `tls-aws-lc`). Users of `tls-roots` or `tls-webpki-roots` must now also enable one of these. - Prevent logging of header values in OTLP tonic exporter [#​3465](https://redirect.github.com/open-telemetry/opentelemetry-rust/pull/3465)
open-telemetry/opentelemetry-rust (opentelemetry-semantic-conventions) ### [`v0.32.1`](https://redirect.github.com/open-telemetry/opentelemetry-rust/blob/HEAD/opentelemetry-semantic-conventions/CHANGELOG.md#0321) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-rust/compare/opentelemetry-semantic-conventions-0.32.0...opentelemetry-semantic-conventions-0.32.1) Released 2026-Jun-26 - Update to [v1.42.0](https://redirect.github.com/open-telemetry/semantic-conventions/releases/tag/v1.42.0) of the semantic conventions. ### [`v0.32.0`](https://redirect.github.com/open-telemetry/opentelemetry-rust/blob/HEAD/opentelemetry-semantic-conventions/CHANGELOG.md#0320) [Compare Source](https://redirect.github.com/open-telemetry/opentelemetry-rust/compare/v0.31.0...opentelemetry-semantic-conventions-0.32.0) Released 2026-May-08
tokio-rs/tracing-opentelemetry (tracing-opentelemetry) ### [`v0.33.0`](https://redirect.github.com/tokio-rs/tracing-opentelemetry/blob/HEAD/CHANGELOG.md#0330---2026-05-18) [Compare Source](https://redirect.github.com/tokio-rs/tracing-opentelemetry/compare/v0.32.1...v0.33.0) ##### Fixed - \[**breaking**] avoid deadlock when entering a span ([#​251](https://redirect.github.com/tokio-rs/tracing-opentelemetry/pull/251)) ##### Other - Upgrade to OpenTelemetry 0.32, see [upstream changelog](https://redirect.github.com/open-telemetry/opentelemetry-rust/blob/main/opentelemetry-sdk/CHANGELOG.md#0320) for details ([#​258](https://redirect.github.com/tokio-rs/tracing-opentelemetry/pull/258)) - mimimize package size ([#​252](https://redirect.github.com/tokio-rs/tracing-opentelemetry/pull/252))
--- ### Configuration πŸ“… **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. πŸ‘» **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/DiamondLightSource/numtracker). --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Peter Holloway --- Cargo.lock | 98 ++++++++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 10 +++--- 2 files changed, 82 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7065352..fc8ffac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2204,7 +2204,7 @@ dependencies = [ "opentelemetry-otlp", "opentelemetry-semantic-conventions", "opentelemetry_sdk", - "reqwest", + "reqwest 0.12.28", "rstest", "serde", "serde_json", @@ -2230,7 +2230,7 @@ dependencies = [ "getrandom 0.2.17", "http", "rand 0.8.6", - "reqwest", + "reqwest 0.12.28", "serde", "serde_json", "serde_path_to_error", @@ -2284,9 +2284,9 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bcd6ae87133e903af7ef497404dda70c60d0ea14895fc8a5e6722754fc2a0" +checksum = "b0142c63252a9e054e68a4c61a5778f7b14f576274d593f8ce883d191a099682" dependencies = [ "futures-core", "futures-sink", @@ -2298,22 +2298,22 @@ dependencies = [ [[package]] name = "opentelemetry-http" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a6d09a73194e6b66df7c8f1b680f156d916a1a942abf2de06823dd02b7855d" +checksum = "5683015d09e2df236ef005b17f6f196f0d5f6313c4fa43a7b6a53b52776e4331" dependencies = [ "async-trait", "bytes", "http", "opentelemetry", - "reqwest", + "reqwest 0.13.4", ] [[package]] name = "opentelemetry-otlp" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f69cd6acbb9af919df949cd1ec9e5e7fdc2ef15d234b6b795aaa525cc02f71f" +checksum = "9966929966d17620d7c316c643ba62631826e10021409357772d5eea84f62c35" dependencies = [ "http", "opentelemetry", @@ -2321,18 +2321,18 @@ dependencies = [ "opentelemetry-proto", "opentelemetry_sdk", "prost", - "reqwest", + "reqwest 0.13.4", "thiserror 2.0.18", "tokio", "tonic", - "tracing", + "tonic-types", ] [[package]] name = "opentelemetry-proto" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7175df06de5eaee9909d4805a3d07e28bb752c34cab57fa9cff549da596b30f" +checksum = "56d658ba1faf63f7b9c492cfbe6e0ec365440a16132d3270c1065f7b33f1b638" dependencies = [ "opentelemetry", "opentelemetry_sdk", @@ -2343,21 +2343,22 @@ dependencies = [ [[package]] name = "opentelemetry-semantic-conventions" -version = "0.31.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e62e29dfe041afb8ed2a6c9737ab57db4907285d999ef8ad3a59092a36bdc846" +checksum = "c913ac17a6c451661ee255f4625d143e51647ae78ebd969b75e41c4442f4fe47" [[package]] name = "opentelemetry_sdk" -version = "0.31.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ae4f5991976fd48df6d843de219ca6d31b01daaab2dad5af2badeded372bd" +checksum = "9b59f80e1ac4d5ff7a2db8fb6c80badb7f0f3f858211fba08dd9aaec750894f9" dependencies = [ "futures-channel", "futures-executor", "futures-util", "opentelemetry", "percent-encoding", + "portable-atomic", "rand 0.9.4", "thiserror 2.0.18", "tokio", @@ -2566,6 +2567,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "portable-atomic" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + [[package]] name = "potential_utf" version = "0.1.5" @@ -2650,6 +2657,15 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "prost-types" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +dependencies = [ + "prost", +] + [[package]] name = "quinn" version = "0.11.9" @@ -2885,9 +2901,7 @@ checksum = "eddd3ca559203180a307f12d114c268abf583f59b03cb906fd0b3ff8646c1147" dependencies = [ "base64 0.22.1", "bytes", - "futures-channel", "futures-core", - "futures-util", "http", "http-body", "http-body-util", @@ -2917,6 +2931,37 @@ dependencies = [ "webpki-roots", ] +[[package]] +name = "reqwest" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "js-sys", + "log", + "percent-encoding", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -3955,6 +4000,17 @@ dependencies = [ "tonic", ] +[[package]] +name = "tonic-types" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399" +dependencies = [ + "prost", + "prost-types", + "tonic", +] + [[package]] name = "tower" version = "0.5.3" @@ -4081,9 +4137,9 @@ dependencies = [ [[package]] name = "tracing-opentelemetry" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac28f2d093c6c477eaa76b23525478f38de514fa9aeb1285738d4b97a9552fc" +checksum = "adbc64cba7137545b8044cb1fe9814f7aacf3c6b5f9b45be8bb5db538befdb26" dependencies = [ "js-sys", "opentelemetry", diff --git a/Cargo.toml b/Cargo.toml index 105cfe6..7a8bf61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,16 +23,16 @@ chrono = "0.4.41" clap = { version = "4.5.38", features = ["cargo", "derive", "env", "string", "wrap_help"] } derive_more = { version = "2.0.1", features = ["error", "display", "from", "deref"] } futures = "0.3.31" -opentelemetry = "0.31.0" -opentelemetry-otlp = { version = "0.31.0", features = ["grpc-tonic"] } -opentelemetry-semantic-conventions = "0.31.0" -opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio"] } +opentelemetry = "0.32.0" +opentelemetry-otlp = { version = "0.32.0", features = ["grpc-tonic"] } +opentelemetry-semantic-conventions = "0.32.0" +opentelemetry_sdk = { version = "0.32.0", features = ["rt-tokio"] } reqwest = { version = "0.12.15", features = ["json", "rustls-tls"], default-features = false } serde = { version = "1.0.219", features = ["derive"] } sqlx = { version = "0.9.0", features = ["runtime-tokio", "sqlite"] } tokio = { version = "1.45.0", features = ["full"] } tracing = "0.1.41" -tracing-opentelemetry = "0.32.0" +tracing-opentelemetry = "0.33.0" tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } url = "2.5.4" From bb84deb29ac8f2a34a83af8e02f7904659fa1f70 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 24 Aug 2026 14:46:17 +0000 Subject: [PATCH 06/22] Update patches (#289) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [built](https://redirect.github.com/lukaslueg/built) | build-dependencies | patch | `0.8.0` β†’ `0.8.1` | | [chrono](https://redirect.github.com/chronotope/chrono) | dependencies | patch | `0.4.44` β†’ `0.4.45` | | [clap](https://redirect.github.com/clap-rs/clap) | dependencies | patch | `4.6.1` β†’ `4.6.6` | | [futures](https://rust-lang.github.io/futures-rs) ([source](https://redirect.github.com/rust-lang/futures-rs)) | dependencies | patch | `0.3.32` β†’ `0.3.34` | | [serde](https://serde.rs) ([source](https://redirect.github.com/serde-rs/serde)) | dependencies | patch | `1.0.228` β†’ `1.0.229` | | [serde_json](https://redirect.github.com/serde-rs/json) | dev-dependencies | patch | `1.0.149` β†’ `1.0.151` | | [toml](https://redirect.github.com/toml-rs/toml) | dependencies | patch | `1.1.2+spec-1.1.0` β†’ `1.1.4` | --- ### Release Notes
lukaslueg/built (built) ### [`v0.8.1`](https://redirect.github.com/lukaslueg/built/blob/HEAD/CHANGELOG.md#081) [Compare Source](https://redirect.github.com/lukaslueg/built/compare/0.8.0...0.8.1) - Honor `CARGO_CFG_FEATURE` - Mangle hyphens in override-variables - Bump MSRV to 1.87, switch to Edition 2024 - Bump `cargo-lock` to `11.0` - Bump `git2` to 0.21 - Add `gix` as an alternative to `libgit2`
chronotope/chrono (chrono) ### [`v0.4.45`](https://redirect.github.com/chronotope/chrono/releases/tag/v0.4.45): 0.4.45 [Compare Source](https://redirect.github.com/chronotope/chrono/compare/v0.4.44...v0.4.45) #### What's Changed - fix(tz): reject TZ offset hour of 24 to avoid FixedOffset overflow by [@​SAY-5](https://redirect.github.com/SAY-5) in [#​1787](https://redirect.github.com/chronotope/chrono/pull/1787) - tz\_data: fix tzdata locations on Android by [@​caruschalalamove](https://redirect.github.com/caruschalalamove) in [#​1789](https://redirect.github.com/chronotope/chrono/pull/1789)
clap-rs/clap (clap) ### [`v4.6.6`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#466---2026-08-06) [Compare Source](https://redirect.github.com/clap-rs/clap/compare/v4.6.5...v4.6.6) ##### Features - Add `Command::get_overridden_usage` ### [`v4.6.5`](https://redirect.github.com/clap-rs/clap/compare/clap_complete-v4.6.4...clap_complete-v4.6.5) [Compare Source](https://redirect.github.com/clap-rs/clap/compare/v4.6.4...v4.6.5) ### [`v4.6.4`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#464---2026-07-21) [Compare Source](https://redirect.github.com/clap-rs/clap/compare/v4.6.3...v4.6.4) ##### Internal - Update to syn v3 ### [`v4.6.3`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#463---2026-07-20) [Compare Source](https://redirect.github.com/clap-rs/clap/compare/v4.6.2...v4.6.3) ##### Fixes - *(derive)* Allow `"literal".function()` as attribute values ### [`v4.6.2`](https://redirect.github.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#462---2026-07-15) [Compare Source](https://redirect.github.com/clap-rs/clap/compare/v4.6.1...v4.6.2) ##### Fixes - *(help)* Say `alias` when there is only one
rust-lang/futures-rs (futures) ### [`v0.3.34`](https://redirect.github.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#0334---2026-08-11) [Compare Source](https://redirect.github.com/rust-lang/futures-rs/compare/0.3.33...0.3.34) - Preserve cloned waker identity. ([#​3032](https://redirect.github.com/rust-lang/futures-rs/issues/3032)) - Updato `syn` to 3. ([#​3028](https://redirect.github.com/rust-lang/futures-rs/issues/3028)) ### [`v0.3.33`](https://redirect.github.com/rust-lang/futures-rs/blob/HEAD/CHANGELOG.md#0333---2026-07-18) [Compare Source](https://redirect.github.com/rust-lang/futures-rs/compare/0.3.32...0.3.33) - Fix `ReadLine`'s soundness issue regarding to exception safety. ([#​3020](https://redirect.github.com/rust-lang/futures-rs/issues/3020)) - Fix unsound `Send` impl for `IterPinRef` and `Iter`. ([#​3003](https://redirect.github.com/rust-lang/futures-rs/issues/3003)) - Fix stacked borrows violation in `compat01as03` implementation. ([#​3012](https://redirect.github.com/rust-lang/futures-rs/issues/3012)) - Fix memory leak in `FuturesUnordered::IntoIter`. ([#​3005](https://redirect.github.com/rust-lang/futures-rs/issues/3005)) - Add `portable-atomic-alloc` feature and use it in `FuturesUnordered`. ([#​3007](https://redirect.github.com/rust-lang/futures-rs/issues/3007)) - Re-export `alloc::task::Wake`. ([#​3010](https://redirect.github.com/rust-lang/futures-rs/issues/3010)) - Update `spin` to 0.12. ([#​3014](https://redirect.github.com/rust-lang/futures-rs/issues/3014))
serde-rs/serde (serde) ### [`v1.0.229`](https://redirect.github.com/serde-rs/serde/releases/tag/v1.0.229) [Compare Source](https://redirect.github.com/serde-rs/serde/compare/v1.0.228...v1.0.229) - Update to syn 3
serde-rs/json (serde_json) ### [`v1.0.151`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.151) [Compare Source](https://redirect.github.com/serde-rs/json/compare/v1.0.150...v1.0.151) - Add RawValue::from\_string\_unchecked ([#​1331](https://redirect.github.com/serde-rs/json/issues/1331), thanks [@​WonderLawrence](https://redirect.github.com/WonderLawrence)) ### [`v1.0.150`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.150) [Compare Source](https://redirect.github.com/serde-rs/json/compare/v1.0.149...v1.0.150) - Reject non-string enum object keys ([#​1324](https://redirect.github.com/serde-rs/json/issues/1324), thanks [@​puneetdixit200](https://redirect.github.com/puneetdixit200))
toml-rs/toml (toml) ### [`v1.1.4`](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.3...toml-v1.1.4) [Compare Source](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.3...toml-v1.1.4) ### [`v1.1.3`](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.2...toml-v1.1.3) [Compare Source](https://redirect.github.com/toml-rs/toml/compare/toml-v1.1.2...toml-v1.1.3)
--- ### Configuration πŸ“… **Schedule**: (UTC) - Branch creation - On day 1 of the month (`* * 1 * *`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. β™» **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. πŸ‘» **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/DiamondLightSource/numtracker). Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- Cargo.lock | 128 +++++++++++++++++++++++++++++------------------------ 1 file changed, 69 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc8ffac..840e49a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,7 +68,7 @@ version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -79,7 +79,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -433,9 +433,9 @@ dependencies = [ [[package]] name = "built" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ad8f11f288f48ca24471bbd51ac257aaeaaa07adae295591266b792902ae64" +checksum = "5c0e531d93d39c34eef561e929e8a7f86d77a5af08aac4f6d6e39976c51858e9" dependencies = [ "chrono", "git2", @@ -499,9 +499,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.44" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.6.1" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" dependencies = [ "clap_builder", "clap_derive", @@ -523,9 +523,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.6.0" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" dependencies = [ "anstream", "anstyle", @@ -536,14 +536,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.6.1" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.4", ] [[package]] @@ -910,7 +910,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -1026,7 +1026,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -1137,9 +1137,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" dependencies = [ "futures-channel", "futures-core", @@ -1152,9 +1152,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" dependencies = [ "futures-core", "futures-sink", @@ -1162,15 +1162,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-executor" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" dependencies = [ "futures-core", "futures-task", @@ -1190,9 +1190,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" [[package]] name = "futures-lite" @@ -1206,26 +1206,26 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.4", ] [[package]] name = "futures-sink" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" [[package]] name = "futures-task" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-timer" @@ -1235,9 +1235,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.32" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-channel", "futures-core", @@ -1304,15 +1304,14 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.4" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b88256088d75a56f8ecfa070513a775dd9107f6530ef14919dac831af9cfe2b" +checksum = "ddddbf932745a6be37109b6112d3ee09696106f848449069d3a57bba937ab82e" dependencies = [ "bitflags", "libc", "libgit2-sys", "log", - "url", ] [[package]] @@ -1959,9 +1958,9 @@ checksum = "52ff2c0fe9bc6cb6b14a0592c2ff4fa9ceb83eea9db979b0487cd054946a2b8f" [[package]] name = "libgit2-sys" -version = "0.18.3+1.9.2" +version = "0.18.8+1.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9b3acc4b91781bb0b3386669d325163746af5f6e4f73e6d2d630e09a35f3487" +checksum = "7f7c568b25d7489bc3fb2988ed69ab111d2944d2f5fec3d5c987fe545ea97b50" dependencies = [ "cc", "libc", @@ -2111,7 +2110,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3060,7 +3059,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3162,9 +3161,9 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", @@ -3182,29 +3181,29 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.117", + "syn 3.0.4", ] [[package]] name = "serde_json" -version = "1.0.149" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ "indexmap 2.14.0", "itoa", @@ -3403,7 +3402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" dependencies = [ "libc", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3680,6 +3679,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6275cddf4610d1775e6d1fe9469b2e77d0f39fd98fb7450901b821e0c53649f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "sync_wrapper" version = "1.0.2" @@ -3719,7 +3729,7 @@ dependencies = [ "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.61.2", + "windows-sys 0.52.0", ] [[package]] @@ -3729,7 +3739,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.61.2", + "windows-sys 0.60.2", ] [[package]] @@ -3914,9 +3924,9 @@ dependencies = [ [[package]] name = "toml" -version = "1.1.2+spec-1.1.0" +version = "1.1.4+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f3d15e84cbcd896376e6730314d59fb5a87f31e4b038454184435cd57defee" +checksum = "3aace63f4bbcdfc2c965b059de67119c89c4017a70d633be6c104910f67056f5" dependencies = [ "indexmap 2.14.0", "serde_core", @@ -3950,18 +3960,18 @@ dependencies = [ [[package]] name = "toml_parser" -version = "1.1.2+spec-1.1.0" +version = "1.1.3+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" dependencies = [ "winnow", ] [[package]] name = "toml_writer" -version = "1.1.1+spec-1.1.0" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" +checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2" [[package]] name = "tonic" From f0146a56f744005f5ec31ce1438e895e87ee57fb Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Wed, 2 Sep 2026 14:31:19 +0100 Subject: [PATCH 07/22] add transaction to insert configurations function --- src/db_service.rs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index fb0a312..2b61344 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -326,8 +326,37 @@ impl SqliteScanPathService { pub async fn insert_configurations( &self, configs: &[InstrumentConfiguration], - ) -> Result<(), ()> { - todo!() + ) -> Result<(), sqlx::Error> { + let mut tx = self.pool.begin().await?; + + sqlx::query!("DelETE FROM instrument").execute(&mut tx).await?; + + for config in configs { + sqlx::query!( + "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", + config.name, + config.scan_number, + config.directory, + config.scan, + config.detector, + config.tracker_file_extension + ) + .execute(&mut tx) + .await?; + } + + tx.commit().await?; + Ok(()) + } +} + pub async fn next_scan_configuration( + &self, + instrument: &str, + current_high: Option, + ) -> Result { + let exp = current_high.unwrap_or(0); + query_as!( + DbInstrumentConfig, } pub async fn next_scan_configuration( From 4eaa682b74e672c056aea5537334dd8f8573ad31 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Wed, 2 Sep 2026 16:25:50 +0100 Subject: [PATCH 08/22] add serialisable data transfer object --- src/db_service.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/graphql/mod.rs | 2 +- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index 2b61344..fe5bc0e 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use serde::{Deserialize, Serialize}; use std::fmt; use std::marker::PhantomData; use std::path::Path; @@ -348,7 +349,7 @@ impl SqliteScanPathService { tx.commit().await?; Ok(()) } -} + pub async fn next_scan_configuration( &self, instrument: &str, @@ -406,6 +407,8 @@ impl fmt::Debug for SqliteScanPathService { mod error { use derive_more::{Display, Error, From}; +use crate::db_service::InstrumentConfiguration; + #[derive(Debug, Display, Error, From)] pub enum ConfigurationError { #[display("No configuration available for instrument {_0:?}")] @@ -428,6 +431,46 @@ mod error { Self::MissingField(value.into()) } } + + #[derive(Debug, Serialize, Deserialize)] // Adding DTO (Data Transfer Object) for serialisation and deserialisation of instrument configuration data + pub struct InstrumentConfigurationData { + pub name: String, + pub scan_number: u32, + pub directory: String, + pub scan: String, + pub detector: String, + pub tracker_file_extension: Option, + } + + + impl From for Instrument ConfigurationData { + fn from(config: InstrumentConfiguration) -> Self { + Self { + name: config.name, + scan_number: config.scan_number, + directory: config.directory.to_string(), + scan: config.scan.to_string(), + detector: config.detector.to_string(), + tracker_file_extension: config.tracker_file_extension, + } + } + } + impl From for Instrument Configuration { + fn from(data: InstrumentConfigurationData) -> Self { + Self { + name:data.name, + scan_number:data.scan_number, + directory:data.directory.to_string(), + scan:data.scan.to_string(), + detector:data.detector.to_string(), + tracker_file_extension:data.tracker_file_extension, + } + } + } + + + + } #[cfg(test)] diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 966df69..2815c33 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -107,7 +107,7 @@ pub async fn serve_graphql(opts: ServeOptions) { } async fn export_handler(State(db): State) -> String { - let configs = db.all_configurations().await; + #let configs = db.all_configurations().await; return format!("{configs:?}"); } From 9ed6047b24dc0b0ceca0eb255ef713faa73af4a1 Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Thu, 3 Sep 2026 10:29:44 +0000 Subject: [PATCH 09/22] Add prek configuration to check linting prior to CI (#296) --- .github/workflows/ci.yml | 2 +- .gitignore | 2 +- justfile | 9 +++++++++ prek.toml | 24 ++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 justfile create mode 100644 prek.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9318b9..883860d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,7 +81,7 @@ jobs: run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - name: Upload coverage to Codecov - uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 + uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7 with: files: lcov.info fail_ci_if_error: true diff --git a/.gitignore b/.gitignore index dba0af2..d79ca70 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ # Demo database and file number directories *.db -trackers/ \ No newline at end of file +trackers/ diff --git a/justfile b/justfile new file mode 100644 index 0000000..d298250 --- /dev/null +++ b/justfile @@ -0,0 +1,9 @@ +lint: + prek run --all-files + +test: + cargo test + +coverage: + cargo tarpaulin --target-dir target/coverage --skip-clean + xdg-open tarpaulin-report.html diff --git a/prek.toml b/prek.toml new file mode 100644 index 0000000..3ccf7d1 --- /dev/null +++ b/prek.toml @@ -0,0 +1,24 @@ +[[repos]] +repo = "builtin" +hooks = [ + { id = "check-added-large-files", exclude = "^Cargo.lock$" }, + { id = "check-merge-conflict" }, + { id = "check-toml" }, + { id = "end-of-file-fixer" }, + { id = "mixed-line-ending", args = ["--fix", "lf" ]}, + { id = "trailing-whitespace", exclude = "static/service_schema.graphql"}, +] + +[[repos]] +repo = "local" +hooks = [ + # fmt needs to be called via rustup to support nightly + { id = "format", name = "cargo fmt", entry = "rustup run nightly cargo fmt", language = "rust", pass_filenames = false }, + { id = "compile", name = "cargo check", entry = "cargo check", language = "rust", pass_filenames = false }, + { id = "lint", name = "cargo clippy", entry = "cargo clippy --all-targets --all-features -- --deny warnings", language = "rust" , pass_filenames = false }, +] + +[[repos]] +repo = "https://github.com/gitleaks/gitleaks" +rev = "v8.30.1" +hooks = [{ id = "gitleaks" }] From 963d3cb26085a3a3832c04004d8d2eabb41b4057 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Thu, 3 Sep 2026 11:32:22 +0100 Subject: [PATCH 10/22] add force clear and exisiting configs check to transaction --- src/db_service.rs | 62 ++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index fe5bc0e..5bc3e0f 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -23,6 +23,7 @@ use sqlx::sqlite::{SqliteConnectOptions, SqliteRow}; use sqlx::{query_as, FromRow, QueryBuilder, Row, Sqlite, SqlitePool}; use tracing::{info, instrument, trace}; +use crate::db_service::error::InsertConfigurationsError; use crate::paths::{ DetectorField, DetectorTemplate, DirectoryField, DirectoryTemplate, InvalidPathTemplate, PathSpec, ScanField, ScanTemplate, @@ -221,7 +222,7 @@ impl InstrumentConfigurationUpdate { } } -#[derive(Debug)] +#[derive(Debug, Deserialize, Serialize)] struct DbInstrumentConfig { #[allow(unused)] // unused but allows use of 'SELECT * ...' queries id: Option, @@ -327,10 +328,19 @@ impl SqliteScanPathService { pub async fn insert_configurations( &self, configs: &[InstrumentConfiguration], - ) -> Result<(), sqlx::Error> { + force_clear: bool, + ) -> Result<(), InsertConfigurationsError> { let mut tx = self.pool.begin().await?; - sqlx::query!("DelETE FROM instrument").execute(&mut tx).await?; + if force_clear{ sqlx::query!("DELETE FROM instrument").execute(&mut tx).await?; } //User has chosen to overwrite existing data so delete the table before inserting new rows + else if !configs.is_empty() { // Not forcing clear and configs is not empty, check if table is empty + let count: (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") + .fetch_one(&mut tx) + .await?; + if count.0 > 0 { //Table not empty, do not clear + return Err(InsertConfigurationsError::NotEmpty); + } + } for config in configs { sqlx::query!( @@ -431,46 +441,16 @@ use crate::db_service::InstrumentConfiguration; Self::MissingField(value.into()) } } - - #[derive(Debug, Serialize, Deserialize)] // Adding DTO (Data Transfer Object) for serialisation and deserialisation of instrument configuration data - pub struct InstrumentConfigurationData { - pub name: String, - pub scan_number: u32, - pub directory: String, - pub scan: String, - pub detector: String, - pub tracker_file_extension: Option, - } - - - impl From for Instrument ConfigurationData { - fn from(config: InstrumentConfiguration) -> Self { - Self { - name: config.name, - scan_number: config.scan_number, - directory: config.directory.to_string(), - scan: config.scan.to_string(), - detector: config.detector.to_string(), - tracker_file_extension: config.tracker_file_extension, - } - } - } - impl From for Instrument Configuration { - fn from(data: InstrumentConfigurationData) -> Self { - Self { - name:data.name, - scan_number:data.scan_number, - directory:data.directory.to_string(), - scan:data.scan.to_string(), - detector:data.detector.to_string(), - tracker_file_extension:data.tracker_file_extension, - } - } + + #[derive(Debug, Display, Error, From)] + pub enum InsertConfigurationsError { + #[display("Instrument table not empty and force_clear not set to true")] + NotEmpty, + #[from] + #[display("Error inserting configurations: {_0}")] + Db(sqlx::Error), } - - - } #[cfg(test)] From 3d52581622c1db4bcf0c346a87e8cfb2f392d9c8 Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Thu, 3 Sep 2026 10:41:13 +0000 Subject: [PATCH 11/22] Remove async-std dependency (#300) It may have been a requirement of rstest but no longer seems to be needed. --- Cargo.lock | 31 ------------------------------- Cargo.toml | 1 - 2 files changed, 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 840e49a..077091f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,16 +110,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" -[[package]] -name = "async-attributes" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "async-graphql" version = "7.2.1" @@ -252,15 +242,6 @@ dependencies = [ "event-listener", ] -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-attributes", -] - [[package]] name = "async-trait" version = "0.1.89" @@ -2187,7 +2168,6 @@ dependencies = [ "assert_matches", "async-graphql", "async-graphql-axum", - "async-std", "axum", "axum-extra", "built", @@ -3657,17 +3637,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.117" diff --git a/Cargo.toml b/Cargo.toml index 7a8bf61..667d084 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,6 @@ tracing-gelf = "0.9.0" [dev-dependencies] assert_matches = "1.5.0" -async-std = { version = "1.13.1", features = ["attributes"], default-features = false } httpmock = { version = "0.8.0", default-features = false } rstest = "0.26.1" serde_json = { version = "1.0.140", features = ["preserve_order"] } From 6f2341aa6c32228eb280afc426ca7d77aaca598f Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Thu, 3 Sep 2026 13:59:07 +0100 Subject: [PATCH 12/22] patch up compiler errors --- ...e10e8936995349517ac2f31f2e3fe215943b5.json | 12 +++++ ...0949236027cd2523b54c47a23382312cab6d8.json | 12 +++++ src/db_service.rs | 44 ++++++++----------- src/graphql/mod.rs | 2 +- 4 files changed, 43 insertions(+), 27 deletions(-) create mode 100644 .sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json create mode 100644 .sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json diff --git a/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json b/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json new file mode 100644 index 0000000..00f9e4d --- /dev/null +++ b/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 6 + }, + "nullable": [] + }, + "hash": "22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5" +} diff --git a/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json b/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json new file mode 100644 index 0000000..c938239 --- /dev/null +++ b/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM instrument", + "describe": { + "columns": [], + "parameters": { + "Right": 0 + }, + "nullable": [] + }, + "hash": "6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8" +} diff --git a/src/db_service.rs b/src/db_service.rs index 5bc3e0f..522ca29 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -12,18 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -use serde::{Deserialize, Serialize}; use std::fmt; use std::marker::PhantomData; use std::path::Path; -pub use error::ConfigurationError; use error::NewConfigurationError; +pub use error::{ConfigurationError, InsertConfigurationsError}; +use serde::{Deserialize, Serialize}; use sqlx::sqlite::{SqliteConnectOptions, SqliteRow}; use sqlx::{query_as, FromRow, QueryBuilder, Row, Sqlite, SqlitePool}; use tracing::{info, instrument, trace}; -use crate::db_service::error::InsertConfigurationsError; use crate::paths::{ DetectorField, DetectorTemplate, DirectoryField, DirectoryTemplate, InvalidPathTemplate, PathSpec, ScanField, ScanTemplate, @@ -332,12 +331,18 @@ impl SqliteScanPathService { ) -> Result<(), InsertConfigurationsError> { let mut tx = self.pool.begin().await?; - if force_clear{ sqlx::query!("DELETE FROM instrument").execute(&mut tx).await?; } //User has chosen to overwrite existing data so delete the table before inserting new rows - else if !configs.is_empty() { // Not forcing clear and configs is not empty, check if table is empty - let count: (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") - .fetch_one(&mut tx) + if force_clear { + //User has chosen to overwrite existing data so delete the table before inserting new rows + sqlx::query!("DELETE FROM instrument") + .execute(&mut *tx) .await?; - if count.0 > 0 { //Table not empty, do not clear + } else if !configs.is_empty() { + // Not forcing clear, check if table is empty + let (count,): (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") + .fetch_one(&mut *tx) + .await?; + if count > 0 { + //Table not empty, do not clear return Err(InsertConfigurationsError::NotEmpty); } } @@ -347,12 +352,12 @@ impl SqliteScanPathService { "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", config.name, config.scan_number, - config.directory, - config.scan, - config.detector, + config.directory.0, + config.scan.0, + config.detector.0, config.tracker_file_extension ) - .execute(&mut tx) + .execute(&mut *tx) .await?; } @@ -360,16 +365,6 @@ impl SqliteScanPathService { Ok(()) } - pub async fn next_scan_configuration( - &self, - instrument: &str, - current_high: Option, - ) -> Result { - let exp = current_high.unwrap_or(0); - query_as!( - DbInstrumentConfig, - } - pub async fn next_scan_configuration( &self, instrument: &str, @@ -417,8 +412,6 @@ impl fmt::Debug for SqliteScanPathService { mod error { use derive_more::{Display, Error, From}; -use crate::db_service::InstrumentConfiguration; - #[derive(Debug, Display, Error, From)] pub enum ConfigurationError { #[display("No configuration available for instrument {_0:?}")] @@ -441,7 +434,7 @@ use crate::db_service::InstrumentConfiguration; Self::MissingField(value.into()) } } - + #[derive(Debug, Display, Error, From)] pub enum InsertConfigurationsError { #[display("Instrument table not empty and force_clear not set to true")] @@ -450,7 +443,6 @@ use crate::db_service::InstrumentConfiguration; #[display("Error inserting configurations: {_0}")] Db(sqlx::Error), } - } #[cfg(test)] diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 2815c33..966df69 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -107,7 +107,7 @@ pub async fn serve_graphql(opts: ServeOptions) { } async fn export_handler(State(db): State) -> String { - #let configs = db.all_configurations().await; + let configs = db.all_configurations().await; return format!("{configs:?}"); } From ed4f11aa7d6b4a97350a47b3fdb4d4472e3772ec Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Thu, 3 Sep 2026 16:01:26 +0100 Subject: [PATCH 13/22] add restore handler --- src/graphql/mod.rs | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 2815c33..7e85eac 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -36,6 +36,8 @@ use axum_extra::headers::Authorization; use axum_extra::TypedHeader; use chrono::{Datelike, Local}; use derive_more::{Display, Error}; +use serde::Deserialize; +use serde::de::value::MapDeserializer; use tokio::net::TcpListener; use tokio::select; use tokio::signal::unix::{signal, SignalKind}; @@ -43,8 +45,7 @@ use tracing::{debug, info, instrument, trace, warn}; use crate::build_info::ServerStatus; use crate::cli::ServeOptions; -use crate::db_service::{ - InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, +use crate::db_service::{InsertConfigurationsError,InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, }; use crate::numtracker::NumTracker; use crate::paths::{ @@ -77,7 +78,7 @@ pub async fn serve_graphql(opts: ServeOptions) { // making graphql queries .route("/status", get(server_status)) .route("/admin/export", get(export_handler)) - // .route("/admin/restore", post(restore_handler)) + .route("/admin/restore", post(restore_handler)) .route("/graphql", post(graphql_handler)) // make it obvious that /graphql isn't expected to work when visiting from a browser .route( @@ -106,9 +107,20 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } -async fn export_handler(State(db): State) -> String { - #let configs = db.all_configurations().await; - return format!("{configs:?}"); +async fn export_handler(State(db): State,) -> Result>, (StatusCode)> { + let configs = db.all_configurations().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + Ok(Json(configs)) +} + +async fn restore_handler( + State(db): State, + Query(params): Query, + Json(configs): Json>, +) -> Result { + db.insert_configurations(&configs, params.force_clear) + .await + .map_err(|e|match e{InsertConfigurationsError::NotEmpty => StatusCode::CONFLICT, InstrumentConfigurationError::Db(_) =>StatusCode::INTERNAL_SERVER_ERROR})?; + Ok("Configurations restored".into()) } async fn create_signal_handler() { @@ -144,6 +156,12 @@ async fn graphql_handler( .into() } +#[derive(Debug, Deserialize)] +struct ImportParams{ + #[serde(default)] + force_clear: bool, +} + /// Read-only API for GraphQL struct Query; From 720de156c51a94e3cce8f3c8d893f927867cc658 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Fri, 4 Sep 2026 14:13:19 +0100 Subject: [PATCH 14/22] add serialise deserialise to instrumentconfiguration --- src/db_service.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db_service.rs b/src/db_service.rs index 522ca29..f3df6e5 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -61,7 +61,7 @@ impl From<&str> for RawPathTemplate { } /// The current configuration for an instrument -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct InstrumentConfiguration { name: String, scan_number: u32, @@ -337,6 +337,7 @@ impl SqliteScanPathService { .execute(&mut *tx) .await?; } else if !configs.is_empty() { + // maybe get rid of this // Not forcing clear, check if table is empty let (count,): (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") .fetch_one(&mut *tx) From 1fc4e347b525c81d0c9256682e3b1393cc2d662c Mon Sep 17 00:00:00 2001 From: Peter Holloway Date: Wed, 19 Aug 2026 15:31:40 +0100 Subject: [PATCH 15/22] Initial outline of backup/restore --- src/db_service.rs | 7 +++++++ src/graphql/mod.rs | 11 ++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/db_service.rs b/src/db_service.rs index c1eaa51..8f4dad7 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -323,6 +323,13 @@ impl SqliteScanPathService { .collect()) } + pub async fn insert_configurations( + &self, + configs: &[InstrumentConfiguration], + ) -> Result<(), ()> { + todo!() + } + pub async fn next_scan_configuration( &self, instrument: &str, diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 707d42b..966df69 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -26,6 +26,7 @@ use async_graphql::{ }; use async_graphql_axum::{GraphQLRequest, GraphQLResponse}; use auth::{AuthError, PolicyCheck}; +use axum::extract::State; use axum::http::StatusCode; use axum::response::{Html, IntoResponse}; use axum::routing::{get, post}; @@ -67,7 +68,7 @@ pub async fn serve_graphql(opts: ServeOptions) { let schema = Schema::build(Query, Mutation, EmptySubscription) .extension(Tracing) .limit_directives(32) - .data(db) + .data(db.clone()) .data(directory_numtracker) .data(opts.policy.map(PolicyCheck::new)) .finish(); @@ -75,6 +76,8 @@ pub async fn serve_graphql(opts: ServeOptions) { // status check endpoint allows external processes to monitor status of server without // making graphql queries .route("/status", get(server_status)) + .route("/admin/export", get(export_handler)) + // .route("/admin/restore", post(restore_handler)) .route("/graphql", post(graphql_handler)) // make it obvious that /graphql isn't expected to work when visiting from a browser .route( @@ -88,6 +91,7 @@ pub async fn serve_graphql(opts: ServeOptions) { // Interactive graphiql playground .route("/graphiql", get(graphiql)) // Make it look less like something is broken when going to any other page + .with_state(db) .fallback(( StatusCode::NOT_FOUND, Html(include_str!("../../static/404.html")), @@ -102,6 +106,11 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } +async fn export_handler(State(db): State) -> String { + let configs = db.all_configurations().await; + return format!("{configs:?}"); +} + async fn create_signal_handler() { let mut term = signal(SignalKind::terminate()).expect("Failed to create SIGTERM listener"); let mut int = signal(SignalKind::interrupt()).expect("Failed to create SIGINT listener"); From ec78f00f726d5a0d90918b7f3babc99ad137cf31 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Wed, 2 Sep 2026 14:31:19 +0100 Subject: [PATCH 16/22] add transaction to insert configurations function --- src/db_service.rs | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index 8f4dad7..0a57e45 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -326,8 +326,37 @@ impl SqliteScanPathService { pub async fn insert_configurations( &self, configs: &[InstrumentConfiguration], - ) -> Result<(), ()> { - todo!() + ) -> Result<(), sqlx::Error> { + let mut tx = self.pool.begin().await?; + + sqlx::query!("DelETE FROM instrument").execute(&mut tx).await?; + + for config in configs { + sqlx::query!( + "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", + config.name, + config.scan_number, + config.directory, + config.scan, + config.detector, + config.tracker_file_extension + ) + .execute(&mut tx) + .await?; + } + + tx.commit().await?; + Ok(()) + } +} + pub async fn next_scan_configuration( + &self, + instrument: &str, + current_high: Option, + ) -> Result { + let exp = current_high.unwrap_or(0); + query_as!( + DbInstrumentConfig, } pub async fn next_scan_configuration( From c9414c54be0849eb744bc296d5e576c7de113076 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Wed, 2 Sep 2026 16:25:50 +0100 Subject: [PATCH 17/22] add serialisable data transfer object --- src/db_service.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++- src/graphql/mod.rs | 2 +- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index 0a57e45..ba706e4 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use serde::{Deserialize, Serialize}; use std::fmt; use std::marker::PhantomData; use std::path::Path; @@ -348,7 +349,7 @@ impl SqliteScanPathService { tx.commit().await?; Ok(()) } -} + pub async fn next_scan_configuration( &self, instrument: &str, @@ -406,6 +407,8 @@ impl fmt::Debug for SqliteScanPathService { mod error { use derive_more::{Display, Error, From}; +use crate::db_service::InstrumentConfiguration; + #[derive(Debug, Display, Error, From)] pub enum ConfigurationError { #[display("No configuration available for instrument {_0:?}")] @@ -428,6 +431,46 @@ mod error { Self::MissingField(value.into()) } } + + #[derive(Debug, Serialize, Deserialize)] // Adding DTO (Data Transfer Object) for serialisation and deserialisation of instrument configuration data + pub struct InstrumentConfigurationData { + pub name: String, + pub scan_number: u32, + pub directory: String, + pub scan: String, + pub detector: String, + pub tracker_file_extension: Option, + } + + + impl From for Instrument ConfigurationData { + fn from(config: InstrumentConfiguration) -> Self { + Self { + name: config.name, + scan_number: config.scan_number, + directory: config.directory.to_string(), + scan: config.scan.to_string(), + detector: config.detector.to_string(), + tracker_file_extension: config.tracker_file_extension, + } + } + } + impl From for Instrument Configuration { + fn from(data: InstrumentConfigurationData) -> Self { + Self { + name:data.name, + scan_number:data.scan_number, + directory:data.directory.to_string(), + scan:data.scan.to_string(), + detector:data.detector.to_string(), + tracker_file_extension:data.tracker_file_extension, + } + } + } + + + + } #[cfg(test)] diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 966df69..2815c33 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -107,7 +107,7 @@ pub async fn serve_graphql(opts: ServeOptions) { } async fn export_handler(State(db): State) -> String { - let configs = db.all_configurations().await; + #let configs = db.all_configurations().await; return format!("{configs:?}"); } From ccd65193efdf3c7d3c48faa00a8f59f6afb8e2f9 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Thu, 3 Sep 2026 11:32:22 +0100 Subject: [PATCH 18/22] add force clear and exisiting configs check to transaction --- src/db_service.rs | 62 ++++++++++++++++------------------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/src/db_service.rs b/src/db_service.rs index ba706e4..ca87cbc 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -23,6 +23,7 @@ use sqlx::sqlite::{SqliteConnectOptions, SqliteRow}; use sqlx::{query_as, FromRow, QueryBuilder, Row, Sqlite, SqlitePool}; use tracing::{info, instrument, trace}; +use crate::db_service::error::InsertConfigurationsError; use crate::paths::{ DetectorField, DetectorTemplate, DirectoryField, DirectoryTemplate, InvalidPathTemplate, PathSpec, ScanField, ScanTemplate, @@ -221,7 +222,7 @@ impl InstrumentConfigurationUpdate { } } -#[derive(Debug)] +#[derive(Debug, Deserialize, Serialize)] struct DbInstrumentConfig { #[allow(unused)] // unused but allows use of 'SELECT * ...' queries id: Option, @@ -327,10 +328,19 @@ impl SqliteScanPathService { pub async fn insert_configurations( &self, configs: &[InstrumentConfiguration], - ) -> Result<(), sqlx::Error> { + force_clear: bool, + ) -> Result<(), InsertConfigurationsError> { let mut tx = self.pool.begin().await?; - sqlx::query!("DelETE FROM instrument").execute(&mut tx).await?; + if force_clear{ sqlx::query!("DELETE FROM instrument").execute(&mut tx).await?; } //User has chosen to overwrite existing data so delete the table before inserting new rows + else if !configs.is_empty() { // Not forcing clear and configs is not empty, check if table is empty + let count: (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") + .fetch_one(&mut tx) + .await?; + if count.0 > 0 { //Table not empty, do not clear + return Err(InsertConfigurationsError::NotEmpty); + } + } for config in configs { sqlx::query!( @@ -431,46 +441,16 @@ use crate::db_service::InstrumentConfiguration; Self::MissingField(value.into()) } } - - #[derive(Debug, Serialize, Deserialize)] // Adding DTO (Data Transfer Object) for serialisation and deserialisation of instrument configuration data - pub struct InstrumentConfigurationData { - pub name: String, - pub scan_number: u32, - pub directory: String, - pub scan: String, - pub detector: String, - pub tracker_file_extension: Option, - } - - - impl From for Instrument ConfigurationData { - fn from(config: InstrumentConfiguration) -> Self { - Self { - name: config.name, - scan_number: config.scan_number, - directory: config.directory.to_string(), - scan: config.scan.to_string(), - detector: config.detector.to_string(), - tracker_file_extension: config.tracker_file_extension, - } - } - } - impl From for Instrument Configuration { - fn from(data: InstrumentConfigurationData) -> Self { - Self { - name:data.name, - scan_number:data.scan_number, - directory:data.directory.to_string(), - scan:data.scan.to_string(), - detector:data.detector.to_string(), - tracker_file_extension:data.tracker_file_extension, - } - } + + #[derive(Debug, Display, Error, From)] + pub enum InsertConfigurationsError { + #[display("Instrument table not empty and force_clear not set to true")] + NotEmpty, + #[from] + #[display("Error inserting configurations: {_0}")] + Db(sqlx::Error), } - - - } #[cfg(test)] From 67089536872bf6b4d90d8408497d874e7e10cd0e Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Thu, 3 Sep 2026 16:01:26 +0100 Subject: [PATCH 19/22] add restore handler --- src/graphql/mod.rs | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 2815c33..7e85eac 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -36,6 +36,8 @@ use axum_extra::headers::Authorization; use axum_extra::TypedHeader; use chrono::{Datelike, Local}; use derive_more::{Display, Error}; +use serde::Deserialize; +use serde::de::value::MapDeserializer; use tokio::net::TcpListener; use tokio::select; use tokio::signal::unix::{signal, SignalKind}; @@ -43,8 +45,7 @@ use tracing::{debug, info, instrument, trace, warn}; use crate::build_info::ServerStatus; use crate::cli::ServeOptions; -use crate::db_service::{ - InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, +use crate::db_service::{InsertConfigurationsError,InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, }; use crate::numtracker::NumTracker; use crate::paths::{ @@ -77,7 +78,7 @@ pub async fn serve_graphql(opts: ServeOptions) { // making graphql queries .route("/status", get(server_status)) .route("/admin/export", get(export_handler)) - // .route("/admin/restore", post(restore_handler)) + .route("/admin/restore", post(restore_handler)) .route("/graphql", post(graphql_handler)) // make it obvious that /graphql isn't expected to work when visiting from a browser .route( @@ -106,9 +107,20 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } -async fn export_handler(State(db): State) -> String { - #let configs = db.all_configurations().await; - return format!("{configs:?}"); +async fn export_handler(State(db): State,) -> Result>, (StatusCode)> { + let configs = db.all_configurations().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; + Ok(Json(configs)) +} + +async fn restore_handler( + State(db): State, + Query(params): Query, + Json(configs): Json>, +) -> Result { + db.insert_configurations(&configs, params.force_clear) + .await + .map_err(|e|match e{InsertConfigurationsError::NotEmpty => StatusCode::CONFLICT, InstrumentConfigurationError::Db(_) =>StatusCode::INTERNAL_SERVER_ERROR})?; + Ok("Configurations restored".into()) } async fn create_signal_handler() { @@ -144,6 +156,12 @@ async fn graphql_handler( .into() } +#[derive(Debug, Deserialize)] +struct ImportParams{ + #[serde(default)] + force_clear: bool, +} + /// Read-only API for GraphQL struct Query; From 76adde8a8ea7152979f99370f93a421a7cda933f Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Fri, 4 Sep 2026 15:50:08 +0100 Subject: [PATCH 20/22] rebase --- ...e10e8936995349517ac2f31f2e3fe215943b5.json | 12 +++++ ...0949236027cd2523b54c47a23382312cab6d8.json | 12 +++++ src/db_service.rs | 44 ++++++++----------- src/graphql/mod.rs | 6 +++ 4 files changed, 48 insertions(+), 26 deletions(-) create mode 100644 .sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json create mode 100644 .sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json diff --git a/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json b/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json new file mode 100644 index 0000000..00f9e4d --- /dev/null +++ b/.sqlx/query-22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", + "describe": { + "columns": [], + "parameters": { + "Right": 6 + }, + "nullable": [] + }, + "hash": "22237747eeb6181b9e7818733abe10e8936995349517ac2f31f2e3fe215943b5" +} diff --git a/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json b/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json new file mode 100644 index 0000000..c938239 --- /dev/null +++ b/.sqlx/query-6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8.json @@ -0,0 +1,12 @@ +{ + "db_name": "SQLite", + "query": "DELETE FROM instrument", + "describe": { + "columns": [], + "parameters": { + "Right": 0 + }, + "nullable": [] + }, + "hash": "6a62dc83c7ad9074b5ebf42ff730949236027cd2523b54c47a23382312cab6d8" +} diff --git a/src/db_service.rs b/src/db_service.rs index ca87cbc..d5b1871 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -12,18 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. -use serde::{Deserialize, Serialize}; use std::fmt; use std::marker::PhantomData; use std::path::Path; -pub use error::ConfigurationError; use error::NewConfigurationError; +pub use error::{ConfigurationError, InsertConfigurationsError}; +use serde::{Deserialize, Serialize}; use sqlx::sqlite::{SqliteConnectOptions, SqliteRow}; use sqlx::{query_as, FromRow, QueryBuilder, Row, Sqlite, SqlitePool}; use tracing::{info, instrument, trace}; -use crate::db_service::error::InsertConfigurationsError; use crate::paths::{ DetectorField, DetectorTemplate, DirectoryField, DirectoryTemplate, InvalidPathTemplate, PathSpec, ScanField, ScanTemplate, @@ -332,12 +331,18 @@ impl SqliteScanPathService { ) -> Result<(), InsertConfigurationsError> { let mut tx = self.pool.begin().await?; - if force_clear{ sqlx::query!("DELETE FROM instrument").execute(&mut tx).await?; } //User has chosen to overwrite existing data so delete the table before inserting new rows - else if !configs.is_empty() { // Not forcing clear and configs is not empty, check if table is empty - let count: (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") - .fetch_one(&mut tx) + if force_clear { + //User has chosen to overwrite existing data so delete the table before inserting new rows + sqlx::query!("DELETE FROM instrument") + .execute(&mut *tx) .await?; - if count.0 > 0 { //Table not empty, do not clear + } else if !configs.is_empty() { + // Not forcing clear, check if table is empty + let (count,): (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") + .fetch_one(&mut *tx) + .await?; + if count > 0 { + //Table not empty, do not clear return Err(InsertConfigurationsError::NotEmpty); } } @@ -347,12 +352,12 @@ impl SqliteScanPathService { "INSERT INTO instrument (name, scan_number, directory, scan, detector, tracker_file_extension) VALUES (?, ?, ?, ?, ?, ?)", config.name, config.scan_number, - config.directory, - config.scan, - config.detector, + config.directory.0, + config.scan.0, + config.detector.0, config.tracker_file_extension ) - .execute(&mut tx) + .execute(&mut *tx) .await?; } @@ -360,16 +365,6 @@ impl SqliteScanPathService { Ok(()) } - pub async fn next_scan_configuration( - &self, - instrument: &str, - current_high: Option, - ) -> Result { - let exp = current_high.unwrap_or(0); - query_as!( - DbInstrumentConfig, - } - pub async fn next_scan_configuration( &self, instrument: &str, @@ -417,8 +412,6 @@ impl fmt::Debug for SqliteScanPathService { mod error { use derive_more::{Display, Error, From}; -use crate::db_service::InstrumentConfiguration; - #[derive(Debug, Display, Error, From)] pub enum ConfigurationError { #[display("No configuration available for instrument {_0:?}")] @@ -441,7 +434,7 @@ use crate::db_service::InstrumentConfiguration; Self::MissingField(value.into()) } } - + #[derive(Debug, Display, Error, From)] pub enum InsertConfigurationsError { #[display("Instrument table not empty and force_clear not set to true")] @@ -450,7 +443,6 @@ use crate::db_service::InstrumentConfiguration; #[display("Error inserting configurations: {_0}")] Db(sqlx::Error), } - } #[cfg(test)] diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 7e85eac..50d4313 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -107,6 +107,7 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } +<<<<<<< HEAD async fn export_handler(State(db): State,) -> Result>, (StatusCode)> { let configs = db.all_configurations().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; Ok(Json(configs)) @@ -121,6 +122,11 @@ async fn restore_handler( .await .map_err(|e|match e{InsertConfigurationsError::NotEmpty => StatusCode::CONFLICT, InstrumentConfigurationError::Db(_) =>StatusCode::INTERNAL_SERVER_ERROR})?; Ok("Configurations restored".into()) +======= +async fn export_handler(State(db): State) -> String { + let configs = db.all_configurations().await; + return format!("{configs:?}"); +>>>>>>> 6f2341a (patch up compiler errors) } async fn create_signal_handler() { From f137f21d361fd96d7507f3809e0d79753920e097 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Fri, 4 Sep 2026 14:13:19 +0100 Subject: [PATCH 21/22] add serialise deserialise to instrumentconfiguration --- src/db_service.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/db_service.rs b/src/db_service.rs index d5b1871..9d7720a 100644 --- a/src/db_service.rs +++ b/src/db_service.rs @@ -61,7 +61,7 @@ impl From<&str> for RawPathTemplate { } /// The current configuration for an instrument -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)] pub struct InstrumentConfiguration { name: String, scan_number: u32, @@ -337,6 +337,7 @@ impl SqliteScanPathService { .execute(&mut *tx) .await?; } else if !configs.is_empty() { + // maybe get rid of this // Not forcing clear, check if table is empty let (count,): (i64,) = sqlx::query_as("SELECT COUNT(*) FROM instrument") .fetch_one(&mut *tx) From e62f7f72932973709cdcc20a181826861bb07c84 Mon Sep 17 00:00:00 2001 From: Shreelakshmi Iyengar Date: Fri, 4 Sep 2026 16:58:06 +0100 Subject: [PATCH 22/22] remove rebase noise --- src/graphql/mod.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/graphql/mod.rs b/src/graphql/mod.rs index 8c11a23..2911982 100644 --- a/src/graphql/mod.rs +++ b/src/graphql/mod.rs @@ -45,7 +45,7 @@ use tracing::{debug, info, instrument, trace, warn}; use crate::build_info::ServerStatus; use crate::cli::ServeOptions; -use crate::db_service::{InsertConfigurationsError,InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, +use crate::db_service::{InsertConfigurationsError, InstrumentConfiguration, InstrumentConfigurationUpdate, SqliteScanPathService, }; use crate::numtracker::NumTracker; use crate::paths::{ @@ -107,7 +107,6 @@ pub async fn serve_graphql(opts: ServeOptions) { .expect("Can't serve graphql endpoint"); } -<<<<<<< HEAD async fn export_handler(State(db): State,) -> Result>, (StatusCode)> { let configs = db.all_configurations().await.map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?; Ok(Json(configs)) @@ -122,15 +121,6 @@ async fn restore_handler( .await .map_err(|e|match e{InsertConfigurationsError::NotEmpty => StatusCode::CONFLICT, InstrumentConfigurationError::Db(_) =>StatusCode::INTERNAL_SERVER_ERROR})?; Ok("Configurations restored".into()) -======= -async fn export_handler(State(db): State) -> String { - let configs = db.all_configurations().await; - return format!("{configs:?}"); -<<<<<<< HEAD ->>>>>>> 6f2341a (patch up compiler errors) -======= ->>>>>>> 6f2341aa6c32228eb280afc426ca7d77aaca598f ->>>>>>> 720de156c51a94e3cce8f3c8d893f927867cc658 } async fn create_signal_handler() {