From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Subject: Re: GSoC: Adding a web interface similar to the Hydra web interface Date: Sun, 29 Jul 2018 15:25:42 +0200 Message-ID: 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> <87tvoib69u.fsf@lassieur.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000d88129057223480e" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56886) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjlht-0007Gh-Jm for guix-devel@gnu.org; Sun, 29 Jul 2018 09:25:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjlhs-0003Ru-Aj for guix-devel@gnu.org; Sun, 29 Jul 2018 09:25:57 -0400 Received: from mail-it0-x233.google.com ([2607:f8b0:4001:c0b::233]:52489) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjlhs-0003RS-2j for guix-devel@gnu.org; Sun, 29 Jul 2018 09:25:56 -0400 Received: by mail-it0-x233.google.com with SMTP id d9-v6so13523933itf.2 for ; Sun, 29 Jul 2018 06:25:55 -0700 (PDT) In-Reply-To: <87tvoib69u.fsf@lassieur.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: =?UTF-8?Q?Cl=C3=A9ment_Lassieur?= Cc: Guix-devel , Tatiana Sholokhova --000000000000d88129057223480e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable P Cl=C3=A9ment Lassieur ezt =C3=ADrta (id=C5=91pont: 2= 018. j=C3=BAl. 29., V 14:01): > 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) =3D (2,'foo',3); > > > > It even supports NULLs for wildcards, though it's a little more > complicated: > > > > select * from foo where coalesce((a,b,c) =3D (2,NULL,3), 1) =3D 1; > > > > The sqlite C interface doesn't support parameter bindings for the entir= e > > row, though, so you'd have to specify 3 values. > > > > This works: > > > > (sqlite-exec db "select * from foo where (a,b,c) =3D (" 2 "," "foo" "= ," > 3 ");") > > > > but this doesn't work, unfortunately: > > > > (sqlite-exec db "select * from foo where (a,b,c) =3D " '(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 > This is working as expected. Actually this: (a,b)<(c,d) is a shortcut for a How do we use it? Why this is the expected result? > I think we should use: > > select (0 < 1) and (1 < 0); -- returns 0 > select (0 < 0) and (0 < 1); -- returns 0 > Could you please clarify which numbers are the placeholders for which quantities? > > instead, for the pagination borders code. > --000000000000d88129057223480e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
P

Cl=C3=A9ment Lassieur <clement@= lassieur.org> ezt =C3=ADrta (id=C5=91pont: 2018. j=C3=BAl. 29., V 14= :01):
Danny Milosavljevic <d= annym@scratchpost.org> writes:

> Hi Tatiana,
>
> On Sun, 8 Jul 2018 21:48:32 +0200
> Tatiana Sholokhova <tanja201396@gmail.com> 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:
>
>=C2=A0 =C2=A0select * from foo where (a,b,c) =3D (2,'foo',3); >
> It even supports NULLs for wildcards, though it's a little more co= mplicated:
>
>=C2=A0 =C2=A0select * from foo where coalesce((a,b,c) =3D (2,NULL,3), 1= ) =3D 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:
>
>=C2=A0 =C2=A0(sqlite-exec db "select * from foo where (a,b,c) =3D = (" 2 "," "foo" "," 3 ");")
>
> but this doesn't work, unfortunately:
>
>=C2=A0 =C2=A0(sqlite-exec db "select * from foo where (a,b,c) =3D = " '(2 "foo" 3) ";")
>
> See also https://www.sqlite.org/rowvalue.html

With the '<' operator, it doesn't give the results we are lo= oking for, I
think.

For example:

select (0,1) < (1,0); -- returns 1
select (0,0) < (0,1); -- returns 1




=

Could you please clarify whic= h numbers are the placeholders for which quantities?

instead, for the pagination borders code.
=C2=A0
--000000000000d88129057223480e--