[plt-scheme] Query language for writing SQL commands

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Thu Aug 16 16:56:12 EDT 2007

Corey Sweeney skrev:
> The S-expression query languages output would be a string (the "sql command").
> For example:
> (select (field1 field2) (table1 table2) (where (= table1.id table2.id)))
> Gets converted to the string:
> "select all field1, field2 from table1, table2 where table1.id = table2.id"
> I was saying that converting S expressions to strings shoud not
> require anything beyond R5RS.  Of course after you have written the
> command, you still have to run it, but that's a seperate problem.  I
> was just concerned with writing the sql commands.

I know of no such R5RS-packages. If you decide to make such a project,
here are some things to consider:

   1) Different databases expect different SQL-syntax (sigh).
   2) Compile time errors are better than runtime errors.
      (which makes it tricky (read impossible) to implement
       it with syntax-rules only)
   3) The interface to the actual database is non-R5RS anyway.

Jens Axel Søgaard

Posted on the users mailing list.