From 92d35f14a3ae2a3dce0ddc4904aa90254398ff98 Mon Sep 17 00:00:00 2001 From: jorainer Date: Thu, 7 Mar 2024 07:21:26 +0100 Subject: [PATCH] fix: ensure primary keys are in correct order - Ensure the primary keys for spectra are extracted in the correct order in `backendInitialize()`. --- DESCRIPTION | 2 +- NEWS.md | 5 +++++ R/MsBackendSql.R | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1f1cbdb..28f1330 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: MsBackendSql Title: SQL-based Mass Spectrometry Data Backend -Version: 1.3.3 +Version: 1.3.4 Authors@R: c(person(given = "Johannes", family = "Rainer", email = "Johannes.Rainer@eurac.edu", diff --git a/NEWS.md b/NEWS.md index c6588c8..8a73ebf 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,10 @@ # MsBackendSql 1.3 +## Changes in 1.3.4 + +- Ensure primary keys from the database are in the correct order for + `backendInitialize()`. + ## Changes in 1.3.3 - Import method generics from `ProtGenerics`. diff --git a/R/MsBackendSql.R b/R/MsBackendSql.R index 44b9957..1c67cae 100644 --- a/R/MsBackendSql.R +++ b/R/MsBackendSql.R @@ -484,7 +484,8 @@ setMethod("backendInitialize", "MsBackendSql", if (length(msg)) stop(msg) object@dbcon <- dbcon object@spectraIds <- dbGetQuery( - dbcon, "select spectrum_id_ from msms_spectrum")[, 1L] + dbcon, paste0("select spectrum_id_ from msms_spectrum ", + "order by spectrum_id_"))[, 1L] object@.tables <- list( msms_spectrum = colnames( dbGetQuery(dbcon, "select * from msms_spectrum limit 0")))