[racket] Bug in racket db module ??

From: Bikal Gurung (gbikal at gmail.com)
Date: Mon Apr 30 17:37:05 EDT 2012

Hi All,

I am using the racket 'db' module to interact with my postgresql database.
I think there is some mismatch in the documentation towards the end of
section 1.1. Here is my sample repl session.

> (define get-less-than-pst
    (prepare pgc "select n from the_numbers where n < $1"))

> (query-list pgc get-less-than-pst 1)
'(0)
*> (query-list pgc (bind-prepared-statement get-less-than-pst 2))*
*. . bind-prepared-statement: contract violation, expected: list?, given: 2*
*  contract from: <collects>/db/base.rkt, blaming: anonymous-module*
*  contract: *
*    (-> prepared-statement? list? any)*
*  at: <collects>/db/base.rkt:125.2*
*> *
*
*
After checking the documentation for the 'bind-prepared-statement' it
expects a variable and a list as it parameter types. Is this correct or am
I missing something?

Bikal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120430/a4ffee12/attachment.html>

Posted on the users mailing list.