On Fri, Sep 13, 2019 at 1:04 PM Alaric Snell-Pym <xxxxxx@snell-pym.org.uk> wrote:

1) Nicer syntax for SQL than strings - I count SSQL in that camp and use
it as such myself! The transformation here is purely syntactic, but even
then it's complicated, as Peter's blog post illustrates.

Too complicated for me, that's for sure.  I'm not a big believer in porting applications across databases anyway: it hardly ever happens.  Making higher-level libraries work on any database is a more plausible goal, but extremely hard.
 
2) [...]  At the most general extreme of this area
might be a relational algebra DSL that gives you
join/select/project/group/etc operators over relations, implemented in
such a way that you can use arbitrary SQL tables as base relation
constants - but even then you're still only trying to implement a
particular set of semantics defined independently of SQL, using your own
chosen subset of the SQL language your backend gives you.

That's exactly what https://bitbucket.org/cowan/r7rs-wg1-infra/src/default/RelationsCowan.md is all about.  It's out of scope for this mailing list because it's not really about persistence, it's about relations as a data type, just what you describe here.  It's a procedure library rather than a DSL proper, however.
 
"SELECT year_2_column FROM table ORDER BY year_2_column ASC" and get the
result "00, 01, 02, 10, 00, 01, 02", where the latter three values are
actually 100, 101 and 102? Classic :-D

*snerk*


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
SAXParserFactory [is] a hideous, evil monstrosity of a class that should
be hung, shot, beheaded, drawn and quartered, burned at the stake,
buried in unconsecrated ground, dug up, cremated, and the ashes tossed
in the Tiber while the complete cast of Wicked sings "Ding dong, the
witch is dead."  --Elliotte Rusty Harold on xml-dev