From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?Cl=C3=A9ment?= Lassieur Subject: Re: GSoC: Adding a web interface similar to the Hydra web interface Date: Sun, 29 Jul 2018 14:01:01 +0200 Message-ID: <87tvoib69u.fsf@lassieur.org> References: <87in78hxo2.fsf@elephly.net> <878t7xb58o.fsf@elephly.net> <874lijbqvf.fsf@elephly.net> <20180606200210.7a9c4dd6@scratchpost.org> <20180612183504.2621cefa@scratchpost.org> <8736xrd64y.fsf@elephly.net> <8736x8ype9.fsf@gnu.org> <20180705102753.6bc57971@scratchpost.org> <20180708230918.04aa76e0@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjkNp-0007FI-RH for guix-devel@gnu.org; Sun, 29 Jul 2018 08:01:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjkNl-0000zR-0w for guix-devel@gnu.org; Sun, 29 Jul 2018 08:01:09 -0400 Received: from mail.lassieur.org ([83.152.10.219]:60856) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fjkNk-0000zA-PG for guix-devel@gnu.org; Sun, 29 Jul 2018 08:01:04 -0400 In-reply-to: <20180708230918.04aa76e0@scratchpost.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Danny Milosavljevic Cc: guix-devel , Tatiana Sholokhova Danny Milosavljevic writes: > Hi Tatiana, > > On Sun, 8 Jul 2018 21:48:32 +0200 > Tatiana Sholokhova wrote: > >> Do you have ideas on how to >> implement tuple comparison and other routines in SQL and guile in a >> convenient and flexible way? > > sqlite3 supports row values, so the comparison can be > written like this: > > select * from foo where (a,b,c) = (2,'foo',3); > > It even supports NULLs for wildcards, though it's a little more complicated: > > select * from foo where coalesce((a,b,c) = (2,NULL,3), 1) = 1; > > The sqlite C interface doesn't support parameter bindings for the entire > row, though, so you'd have to specify 3 values. > > This works: > > (sqlite-exec db "select * from foo where (a,b,c) = (" 2 "," "foo" "," 3 ");") > > but this doesn't work, unfortunately: > > (sqlite-exec db "select * from foo where (a,b,c) = " '(2 "foo" 3) ";") > > See also https://www.sqlite.org/rowvalue.html With the '<' operator, it doesn't give the results we are looking for, I think. For example: select (0,1) < (1,0); -- returns 1 select (0,0) < (0,1); -- returns 1 In both cases, we'd want it to return 0. I think we should use: select (0 < 1) and (1 < 0); -- returns 0 select (0 < 0) and (0 < 1); -- returns 0 instead, for the pagination borders code.