Jan Vroonhof <vroonhof(a)math.ethz.ch> writes in xemacs-beta(a)xemacs.org:
SL Baur <steve(a)beopen.com> writes:
> Attached are patches to XEmacs 21.1.10 to add runtime support for the
> PostgreSQL relational database.
Did mean for this to go to -patches? Or did you send it here because
it still preliminary..
Three comments...
1. Can we have this as a module pleeeze?
Is the module code stable now? And, are modules built by default?
Personally, I'd prefer it not being a module by default, because libpq
is lightweight and linked shared by default and the Lisp binding is
lightweight (~13k with full debugging enabled).
2.
> Note: This entry point is provided for completeness, but its use is not
> recommended. The preferred way to delete connections is to let the Emacs
> garbage collection mechanism do it.
Isn't this bad in the same way that closing files by finalization
is?
The same issue exists on cleaning up PGresult variables.
In my testing, calling `pq-final' was an insta-crash. How do I do
this correctly? Can I force PGconn and PGresult variables to never be
copied?
3. The harlequin M-BS xanalysis common lisp SQL bindings allow
iterating over the result of a query using map- and do- like
functions. IIRC they do this not by downloading all the results but
by transparently creating a database cursor[1] for you. That would
be very cool.
I'm providing a low-level, policy-free binding to the library. This
functionality can be done easily in additional Lisp code. I got
asynchronous queries[1] working last night. Cursors should work for
free since they're implemented by the Postgres backend in SQL. I'll
try that this afternoon.
Footnotes:
[1] I think cursor is the correct term.
It is.
Footnotes:
[1] The don't buy near as much as I hoped due to unexpected
apparent utter brain damage in the XEmacs event code.