历史版本。 PostgreSQL 7.0 已结束支持。 请参阅 当前版本手册.
第 59 章 Lisp 编程接口
摘要
pg.el是一个面向 emacs 的
Postgres套接字级接口。
作者
由 Eric Marsden 于 1999 年 7 月 21 日撰写。
pg.el是一个面向 emacs(卓越的文本编辑器)的Postgres套接字级接口。该模块能够把一系列 SQL 类型类型强制转换为等价的 Emacs Lisp 类型。它目前既不支持 crypt 或 Kerberos 认证,也不支持大对象。
代码(版本 0.2)以 GNU GPL 许可发布,可从 Eric Marsden获取
自上个版本以来的变更:
现在可以在 XEmacs 下工作(已在 Emacs 19.34 和 20.2 以及 XEmacs 20.4 上测试)
增加了提供数据库元信息的函数(数据库、表、列的列表)
`pg:result' 的参数现在改为 :keywords
对 MULE 有抵抗力
更多自测试代码
请注意这是一个程序员的 API,不提供任何形式的用户界面。示例:
(defun demo ()
(interactive)
(let* ((conn (pg:connect "template1" "postgres" "postgres"))
(res (pg:exec conn "SELECT * from scshdemo WHERE a = 42")))
(message "status is %s" (pg:result res :status))
(message "metadata is %s" (pg:result res :attributes))
(message "data is %s" (pg:result res :tuples))
(pg:disconnect conn)))