Please draft us a Scheme API Lassi Kortela (17 Sep 2019 18:54 UTC)
Re: Please draft us a Scheme API John Cowan (17 Sep 2019 19:08 UTC)
What should Hello World be like? Lassi Kortela (18 Sep 2019 08:41 UTC)
Re: What should Hello World be like? Lassi Kortela (18 Sep 2019 08:54 UTC)
Re: What should Hello World be like? John Cowan (19 Sep 2019 01:14 UTC)
Re: What should Hello World be like? hga@xxxxxx (19 Sep 2019 02:31 UTC)
Re: What should Hello World be like? Lassi Kortela (19 Sep 2019 15:35 UTC)
Re: What should Hello World be like? Peter Bex (19 Sep 2019 18:02 UTC)
Re: What should Hello World be like? hga@xxxxxx (19 Sep 2019 22:50 UTC)
Re: What should Hello World be like? John Cowan (19 Sep 2019 19:46 UTC)
Re: What should Hello World be like? hga@xxxxxx (19 Sep 2019 20:50 UTC)
Re: What should Hello World be like? Lassi Kortela (19 Sep 2019 21:14 UTC)
Re: What should Hello World be like? Peter Bex (20 Sep 2019 07:49 UTC)
Re: What should Hello World be like? Alaric Snell-Pym (20 Sep 2019 10:55 UTC)
Re: What should Hello World be like? John Cowan (20 Sep 2019 13:25 UTC)
Re: What should Hello World be like? John Cowan (20 Sep 2019 14:04 UTC)
Re: What should Hello World be like? Lassi Kortela (23 Sep 2019 10:54 UTC)
Connection strings, and representing them as lists Lassi Kortela (23 Sep 2019 10:57 UTC)
John's Simple SQL API hga@xxxxxx (19 Sep 2019 11:38 UTC)
Re: John's Simple SQL API John Cowan (19 Sep 2019 20:28 UTC)
Re: Please draft us a Scheme API hga@xxxxxx (17 Sep 2019 19:11 UTC)
Re: Please draft us a Scheme API John Cowan (17 Sep 2019 19:12 UTC)
Re: Please draft us a Scheme API Lassi Kortela (17 Sep 2019 19:32 UTC)
Re: Please draft us a Scheme API John Cowan (17 Sep 2019 19:35 UTC)
Re: Please draft us a Scheme API Lassi Kortela (17 Sep 2019 19:27 UTC)

Re: What should Hello World be like? Peter Bex 19 Sep 2019 18:02 UTC
On Thu, Sep 19, 2019 at 06:35:45PM +0300, Lassi Kortela wrote:
> > > (sql-read result-set) -> list
> >
> > > Returns a list of Scheme objects representing the next available row of the result-set.
>
> Is there a particular reason we are representing a row as a list instead of
> a vector? Vectors have the advantage that it's fast to get a given column by
> index, and all rows from a given query ought to have the same number of
> columns.

I think I've mentioned this before: I think it's better to return an
opaque result-set object which is random access.  As far as I know, all
database libraries actually read from the protocol until it's empty
and store the entire result set in memory.

These opaque result set objects can include metadata like type
information about the columns in the result set, which this API lacks
completely.

> > > NULL is represented by the symbol nil.
>
> Is there a particular reason to use nil instead of null? null is native in
> SQL, and we are also planning to use it  for JSON so it'd be nice to be able
> to standardize on it.

I would like to reiterate that I think it's a shame to use the symbol
datatype for this, as it basically means you can't encode anything
else as symbols.  For instance, symbols would be a good match for enum
values or as references to SQL variables for those dialects that support
them.  By encoding null as 'nil, this would create an ambiguity if one
wanted to use symbols for something else.

A special distinct object type would be best, IMO.

> > > (sql-read-all result-set) -> list of lists
> >
> > > Returns all available rows in this result-set.
>
> This is nice to have, and the name is good.

True, except that I would prefer an opaque object like I mentioned
above.  And streaming results only happen in case of server-side cursors
and those are not common.

Cheers,
Peter