Very nice!

 Something to keep in mind for the design:  SQL does not guarantee that column names are unique and treats column order as significant, whereas some other systems do guarantee uniqueness and the order of returned columns may be determined by the query optimizer.  So we need to be able to get the column names in (some) order and then each row in the same order.

sqlite> .headers on
sqlite> .mode columns
sqlite> create table foo(a integer, a integer);
Error: duplicate column name: a
sqlite> create table foo(a integer, b integer);
sqlite> insert into foo values(10,40);
sqlite> select a, b as a from foo;
a           a
----------  ----------
10          40
sqlite> select a, b as a, a + a as a from foo;
a           a           a
----------  ----------  ----------
10          40          20



On Tue, Sep 24, 2019 at 12:20 PM <xxxxxx@ancell-ent.com> wrote:
>> From: Lassi Kortela <xxxxxx@lassi.io>
>> Date: Tuesday, September 24, 2019 10:59 AM
>
>>> Yeah, I prefer R7RS but sdbi should be usable back to ... perhaps
>>> R5RS?  Even R4RS, Scheme 9 from Empty Space is rather cool....
>>
>> The trouble with R[45]RS is that there's so little you can rely on
>> having available, though portable SRFIs of course help.
>
> Well, we need some kind of exception handling and probably floats
> and bignums. Not sure about call/cc.
>
> I suggest R7RS and R6RS as primary targets, and not going out of our
> way to make life difficult for others.

Sounds good.  Here an updated and polished one line description:

A R6RS and R7RS API for any database with a text query language that
returns rectangular results.

See https://github.com/Schemepersist/sdbi-design/blob/master/remit.txt
for the current version and an explanation of rectangular results.

I'll take it as a given we won't go out of our way to make life hard
for previous Scheme standard revisions etc.

- Harold