Jan Vroonhof <vroonhof(a)math.ethz.ch> writes in xemacs-beta(a)xemacs.org:
...
Yes, but still libpq installed (there are already people on various
lists and groups complaining why the debian XEmacs packages requires
the ldap libraries).
That is braindamage(TM) that is specifically made taboo in the binary
kit building guidelines. If the libraries were statically linked in
XEmacs binaries for distribution, there wouldn't be that problem.
I may have much more to say about this in the coming months.
Of course I have nothing against having it default to non-mule on a
plain configure.
> asynchronous queries[1] working last night. Cursors should work
for
> free since they're implemented by the Postgres backend in SQL. I'll
Cool...
I consed up a simple mapping function (just for you :-) last night to
put in the programmer's manual. SQL in Emacs Lisp _really_ rocks.
(This isn't the most general code in the world, but that's not really
important).
Here's another example of cursors, this time with a Lisp macro to
implement a mapping function over a table.
(defmacro map-db (P table condition callout)
`(let (R)
(pq-exec ,P "BEGIN;")
(pq-exec ,P (concat "DECLARE k_cursor CURSOR FOR SELECT * FROM "
,table
" "
,condition
" ORDER BY f1 DESC;"))
(setq R (pq-exec P "FETCH k_cursor;"))
(while (eq (pq-ntuples R) 1)
(,callout (pq-get-value R 0 0) (pq-get-value R 0 1))
(setq R (pq-exec P "FETCH k_cursor;")))
(pq-exec P "END;")))
=> map-db
(defun callback (arg1 arg2)
(message "arg1 = %s, arg2 = %s" arg1 arg2))
=> callback
(map-db P "xemacs_test" "WHERE field2 > 10" callback)
=> arg1 = stuff, arg2 = 42
=> arg1 = b, arg2 = 97
=> arg1 = a string, arg2 = 12
=> arg1 = a, arg2 = 97
=> #<PGresult PGRES_COMMAND_OK - COMMIT>