[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] postgresql: support for query parameters
From: |
Graham Fawcett |
Subject: |
[Chicken-users] postgresql: support for query parameters |
Date: |
Tue, 26 Feb 2008 21:47:27 -0500 |
Hi folks,
I've just checked in a patch to the trunk of the release/3/postgresql
egg, providing support for query parameters. If anyone else is using
this egg, I'd appreciate your checking out this version and testing
it.
In all of the querying procedures, the new interface lets you replace
the query-string argument with a list, (query-string . args). Given a
list, the new code uses the PQsendQueryParams call, so escaping of
parameters is handled automatically.
Examples:
;; old interface (still works)
(pg:query-tuples "select foo, bar from baz" the-conn)
;; new interface
(pg:query-tuples
(list "select foo, bar from baz where foo > $1 and baz < $2"
foo-low baz-high)
the-conn)
Felix, I believe that Johannes is no longer maintaining the postgresql
egg. I would be happy to maintain it if no one objects.
Thanks,
Graham
- [Chicken-users] postgresql: support for query parameters,
Graham Fawcett <=