guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: Allow the package derivation data procedure to not return all dat


From: Christopher Baines
Subject: 01/03: Allow the package derivation data procedure to not return all data
Date: Fri, 20 Nov 2020 14:37:39 -0500 (EST)

cbaines pushed a commit to branch master
in repository data-service.

commit 7b92a6a5b3c832b894bb0cacaeffe585564ff353
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Nov 20 19:28:39 2020 +0000

    Allow the package derivation data procedure to not return all data
    
    By adding after-name and limit-results parameters.
---
 guix-data-service/comparison.scm | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/guix-data-service/comparison.scm b/guix-data-service/comparison.scm
index 6b3ed4d..8003c90 100644
--- a/guix-data-service/comparison.scm
+++ b/guix-data-service/comparison.scm
@@ -254,7 +254,9 @@ GROUP BY derivation_source_files.store_path"))
                                               ;; Build changes are (symbols):
                                               ;; broken, fixed, still-failing,
                                               ;; still-working, unknown
-                                              (build-change 'unknown))
+                                              (build-change 'unknown)
+                                              limit-results
+                                              after-name)
   (define extra-constraints
     (string-append
      (if systems
@@ -374,6 +376,10 @@ WHERE
     base_packages.id != target_packages.id OR
     base_packages.file_name != target_packages.file_name
   )"
+   (if after-name
+       "
+  AND coalesce(base_packages.name, target_packages.name) > $3"
+       "")
    (cond
     ((eq? build-change #f) "")
     ((eq? build-change 'unknown)
@@ -481,9 +487,20 @@ WHERE
          (else
           (error "unknown build-change-value")))))))
    "
-ORDER BY coalesce(base_packages.name, target_packages.name) ASC, 
base_packages.version, target_packages.version"))
+ORDER BY coalesce(base_packages.name, target_packages.name) ASC, 
base_packages.version, target_packages.version"
+   (if limit-results
+       (simple-format
+        #f
+        "
+LIMIT ~A"
+        (number->string limit-results))
+       "")))
 
-  (exec-query conn query (list base_guix_revision_id target_guix_revision_id)))
+  (exec-query conn query `(,base_guix_revision_id
+                           ,target_guix_revision_id
+                           ,@(if after-name
+                                 (list after-name)
+                                 '()))))
 
 (define* (package-differences-data conn
                                    base_guix_revision_id



reply via email to

[Prev in Thread] Current Thread [Next in Thread]