[plt-scheme] Query language for writing SQL commands
Ok, that's what I thought.
While it's a moot point, I will mention that item #3 is not important,
as most implementations have their own way to execute sql command
strings. There would be a value in having a standard way to construct
the strings, even if the underlying connection to the database was not
standardized. #1 is a good point, as it would substantially increase
the maintaince costs (I.E. "per vendor profiles"). I would dispute
#2, but that would lead into a much larger topic.
while I'm at it, does anyone know how to copy a macro? When "select"
is a macro, I tried:
(define-syntax select-orig select)
but did not get anything usefull.
Corey
On 8/16/07, Jens Axel Søgaard <jensaxel at soegaard.net> wrote:
> 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
>
>
>
--
((lambda (y) (y y)) (lambda (y) (y y)))