It has been created as a temporary solution because the JasonFruit?’s script is not available through the link given. As his script, this is based on the code founded at the third item in this page: http://mysite.verizon.net/mbcladwell/.
You can download it from Lisp:sqlite.el page.
This interface has the following features:
The library had some problems that it has been corrected:
The API works with three basic commands. We use a number called “descriptor” for uniquely referencing each connection. The commands
mysql-init give you a unique descriptor.
You can find the following elements:
You may find this variable important, but for working is unnecessary.
‘sqlite-process-alist’: This is an alist in which the key is the descriptor number, and the value is a list with two elements: the process buffer and the filename opened.
(sqlite-init file-path): For starting the sqlite program with its file. It returns a new unique descriptor.
‘file-path’can be a relative or absolute path of the sqlite database file.
(sqlite-query descriptor query-string): For sending a query or a sqlite “.something” command.
(sqlite-bye desriptor): For closing the sqlite program sending a
Just start the program using
sqlite-init, and then query what you want calling
sqlite-query. When you finish using your SQLite database, close the program with
An example of usage:
(require 'sqlite) (let ((descriptor (sqlite-init "~/mydb.sqlite"))) (setq res (sqlite-query descriptor "SELECT * FROM persona")) (sqlite-bye descriptor) res )
This example will try to open mydb.sqlite in your home directory and send the SQL query. You can also send
(sqlite-query descriptor ".tables") for listing the tables.
You can replace the
‘descriptor’ temporal variable with the number when you are trying this in the scratch buffer.