GNU bug report logs - #70494
[PATCH 00/23] Groundwork for the Guile guix-daemon

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 21 Apr 2024 09:37:01 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Ludovic Courtès <ludo <at> gnu.org>
To: Christopher Baines <mail <at> cbaines.net>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 70494 <at> debbugs.gnu.org, Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>, Tobias Geerinckx-Rice <me <at> tobias.gr>, Ricardo Wurmus <rekado <at> elephly.net>, Christopher Baines <guix <at> cbaines.net>
Subject: [bug#70494] [PATCH 10/23] store: database: Add procedures for querying valid paths.
Date: Thu, 16 May 2024 18:04:40 +0200
Hi again! :-)

Christopher Baines <mail <at> cbaines.net> skribis:

> * guix/store/database.scm (valid-path, all-valid-paths,
> valid-path-from-hash-part, valid-path-references): New procedures.
>
> Change-Id: Ib08837ee20f5a5a24a8089e611b5d67b003b62cc

[...]

> +(define (valid-path db store-filename)

Please add docstrings to top-level procedures (info "(guix) Formatting
Code").

> +  (let ((statement
> +         (sqlite-prepare
> +          db
> +          "
> +SELECT id, hash, registrationTime, deriver, narSize
> +FROM ValidPaths
> +WHERE path = :path"
> +          #:cache? #t)))
> +
> +    (sqlite-bind-arguments
> +     statement
> +     #:path store-filename)
> +
> +    (let ((result (sqlite-step statement)))
> +      (sqlite-reset statement)
> +
> +      result)))

Am I right that this returns a vector of 4 elements?

If that’s the case, it should instead return a <valid-path> record (or
similar), and that should be consistent across the interface (except in
case where we explicitly want an ID as input.)  We’d rather not expose
SQLite-related implementation details.

Ludo’.




This bug report was last modified 1 year and 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.