diff options
-rw-r--r-- | guix-data-service/model/location.scm | 16 | ||||
-rw-r--r-- | guix-data-service/model/package-metadata.scm | 2 | ||||
-rw-r--r-- | tests/model-package-metadata.scm | 12 |
3 files changed, 20 insertions, 10 deletions
diff --git a/guix-data-service/model/location.scm b/guix-data-service/model/location.scm index 1a01b9a..9850377 100644 --- a/guix-data-service/model/location.scm +++ b/guix-data-service/model/location.scm @@ -42,13 +42,11 @@ (list file (number->string line) (number->string column))) - (((id)) - (string->number id)) + (((id)) id) (() - (string->number - (caar - (exec-query conn - insert-location - (list file - (number->string line) - (number->string column)))))))))) + (caar + (exec-query conn + insert-location + (list file + (number->string line) + (number->string column))))))))) diff --git a/guix-data-service/model/package-metadata.scm b/guix-data-service/model/package-metadata.scm index 644050e..e83fef9 100644 --- a/guix-data-service/model/package-metadata.scm +++ b/guix-data-service/model/package-metadata.scm @@ -92,7 +92,7 @@ WHERE packages.id IN ( (value->quoted-string-or-null synopsis) "," (value->quoted-string-or-null description) "," (value->quoted-string-or-null home_page) "," - (number->string location_id) + location_id ")"))) metadata-rows) ",") diff --git a/tests/model-package-metadata.scm b/tests/model-package-metadata.scm index 83d77bf..5c0092d 100644 --- a/tests/model-package-metadata.scm +++ b/tests/model-package-metadata.scm @@ -34,6 +34,18 @@ conn (list mock-inferior-package-foo)) ((x) (string? x)))) + #:always-rollback? #t)) + + (with-postgresql-transaction + conn + (lambda (conn) + (test-equal "inferior-packages->package-metadata-ids" + (inferior-packages->package-metadata-ids + conn + (list mock-inferior-package-foo)) + (inferior-packages->package-metadata-ids + conn + (list mock-inferior-package-foo))) #:always-rollback? #t)))))) (test-end) |