[racket] Racket DB Library, data conversion
Nevermind, that seems to be what prepared statements do.
On Sat, Feb 14, 2015 at 9:34 AM, Sean Kanaley <skanaley at gmail.com> wrote:
> Hello All,
>
> I would like to query based on an incoming hash (with help of json
> library), but I don't see a built-in way to generate query needed. There is
> a rows->dict but I don't see either a dict->where-clause or at least
> whatever query uses in that dollar sign magic to convert
> Racket-val->SQL-string.
>
> Currently I have a function which takes a hash and makes "<col1>=$1
> <boolean> <col2>=$2..." so I can then do something like (apply query <the
> above string> <the vals returned by that same function as it built that
> string>). It would be nice and probably more efficient if the value could
> just be spliced in while I build the string to begin with, but it seems
> like only query has such dollar sign conversion power available.
>
> Am I missing something?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150214/c64e6ca5/attachment.html>