[racket] DB and named query parameters

From: Sean McBeth (sean.mcbeth at gmail.com)
Date: Sat Feb 15 17:11:54 EST 2014

All of the examples in the documentation for the db package use either
question-mark placeholders or numbered placeholders, i.e.
"select * from some_table where some_column = ?"
"select * from some_table where some_column = $1"

The three databases that I use (SQL Server, MySQL, and Postgres) all
support the question mark syntax, but you can only refer to a single
parameter once in a query with the question mark.

MySQL and Postgres support numbered parameters, but SQL Server does not. Or
at least, not that I'm aware of. I've never seen anyone use it that way,
and I can't find any examples online.

Regardless, I rather much prefer named parameters, anyway, as it makes the
queries easier to read.
"select * from some_table where some_column = $param1"

I know MySQL, Postgres, AND SQL Server all can support this style (well,
replacing $ with @ for SQL Server), because I have a boat load of C# code
doing it right now.

But there is no indication of how to execute such a query in Racket with DB.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140215/65e4e7d8/attachment.html>

Posted on the users mailing list.