To keep our middle of the stack efforts focused and sane, we should decide on a set of at least two Scheme user level libraries that they will have to adequately support.  Or perhaps substitute one or more applications, see the following comments on previous DSL efforts.

In the running so far are:

John Cowan's Simple SQL, see previous postings to this list: https://srfi-email.schemers.org/schemepersist/msg/12155731/

John also has a more advanced, back to basics idea: https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/RelationsCowan.md

My favorite in Clojure land is the Korma DSL, but Peter Bex has reservations about this general type of DSL, see this blog posting which concludes his SSQL DSL was a failed experiment, except in revealing that sort of DSL is a bad idea: https://www.more-magic.net/posts/lispy-dsl-ssql.html

About Korma, he said "I think it's interesting to see what other SQL-like DSL projects will do. For example, Clojure also has Korma, which is rather close to SQL and looks like it can currently only perform a limited subset of all possible queries. I wonder what they'll do when users start clamoring for richer back-end support?"  Well, its users were last time I checked clamoring for someone to take over maintaining it, up to and including the web site which has been offline for months (copy on GitHub is still there, and I've got copies of all its artifacts).  (That failure, including no one picking it up including myself, *might* have a bit more to do with the declining state of the Clojure tooling community that issues with Korma, or the author.)

Peter, would I be making a terrible mistake to try to create a Scheme version of Korma?  I don't want any more features than it provided, but I'm a fairly basic user of SQL, not ORM oriented, but basic natural normalized OLTP, and OLAP (star schema) designer and user, and contra John's desire to use SQLite's dynamic typing as a natural fit for Scheme data, I prefer to define constraints to keep my data and programming honest.  I doubt I'm a typical user....

About data integrity, an ancedotal factoid I came across recently was several people attesting that more than half the effort required in moving an application with a lot of data from MySQL to PostgreSQL was in cleaning up all the bad data the former had allowed to creep in.

How about a SQL DDL, Data Definition Language library or two?  This is what you use to define your tables, columns, relationships etc.?  I liked Lobos back when I was doing Clojure in the middle of the decade, but that lost support from its single developer even faster than Korma, I'm not sure it was even widely used.

- Harold