On Mon, 31 Jul 2017 22:00:37 -0700 (PDT), Alex Harsanyi
<alexharsa...@gmail.com> wrote:

>On Tuesday, August 1, 2017 at 12:11:24 PM UTC+8, gneuner2 wrote:
>    
>> Hmm.  A change to a query often also means a change to its arguments
>> and/or its result columns, so I don't see that there is much utility
>> in keeping the query strings separate from the program.  
>
>I'm not trying to "abstract" the query away from the code.  I am trying
>to make working with the SQL code easier. I want to update my workflow,
>so that, when I see a line like:
>
>  (define query (sql-query "./some-file.sql"))
>
>I can out the cursor in on the file name inside Emacs, type
>"C-c C-e RET", to open the SQL file, type "C-c C-c" and get the
>query results in the SQL Repl buffer.  I can than edit the file,
>and verify the query, than, I can just save it and the Racket
>program will pick it up.

AFAICS that only works well with [relatively] simple queries. I
frequently have to deal with quite complex queries, e.g., having
several CTEs, conditional clauses, etc.  Dealing with the differences
in argument handling between the embedded (program) environment vs at
the command line or in a SQL editor is a PITA.

YMMV, but I prefer to work it all out in Racket.  The macro I
mentioned isn't perfect, but it allows me do that pretty easily.  I
can compose/debug a complex query in a small test program, and once
I'm sure it works I can just cut/paste it into the real application.

btw: I emailed you the macro file.

George

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to