SL Baur <steve(a)beopen.com> writes:
It was a fun effect watching it when I was testing. Hrvoje was
right, these things are too heavy-weight to be trusted to be closed
by garbage collection. I've been learning programming style as I go
along. It's been fifteen years since I've done any database
programming at this level and I'm still learning how to do it in
Emacs Lisp. :-) My latest code has everything wrapped in
(unwind-protect <> (pq-finish)) wrappers.
If you write lots of code like that, it's probably a good idea to
create a "with-foo" macro:
(with-pq-connection (... connection params ...)
... code ...)
This is analogous to Common Lisp `with-open-file' and friends.
I will update all the examples in the manual before there is any
21.2 release. Most people when learning how to program a new
library/language will start with any provided examples and adjust
them to do what they want. It is highly important that the provided
examples are good ones.
Yes.
This is a real interface instead of a hacked up one parsing textual
output of a non-extensible application. Hacking the output of closed
programs is sometimes the only reasonable way to deal with them,
however, we are gradually taking over the world and open source and
open interfaces are becoming a lot more common. I greatly prefer
using library-style precise interfaces over ad-hoc parse-the-output
interfaces because dealing with libraries is inherently more reliable.
Or put another way, I have many reasons why I want this interface to
be successful in the short-term even if it eventually gets surpassed
by an RDBMS independent one.
It's conceivable that someone will simply _use_ your interface to
implement a Postgres backend to Emacs-DBI. So your work is not
wasted, whatever the outcome.