branch: elpa/emacsql commit 2bc599d85619e0e2bf5263fd9e624f980e4bf79e Author: Christopher Wellons <well...@nullprogram.com> Commit: Christopher Wellons <well...@nullprogram.com>
Add separate package headers for each backend. --- README.md | 4 ++-- emacsql-mysql.el | 11 +++++++++++ emacsql-psql.el | 14 ++++++++++++++ emacsql-sqlite.el | 15 +++++++++++++++ emacsql.el | 29 +++++++++-------------------- 5 files changed, 51 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index c5ec5ee7e3..9220ab9159 100644 --- a/README.md +++ b/README.md @@ -24,12 +24,12 @@ a custom built tool is required. If your own package depends on EmacSQL as a database this means it doesn't have to rely on the user having any particular software installed. -Requires Emacs 24 or later. +Requires Emacs 24.3 or later. ## Example Usage ```el -(defvar db (emacsql-connect "~/company.db")) +(defvar db (emacsql-sqlite "~/company.db")) ;; Create a table. Table and column identifiers are symbols. (emacsql db [:create-table people ([name id salary])]) diff --git a/emacsql-mysql.el b/emacsql-mysql.el index 4531608a7e..8cbe7549b8 100644 --- a/emacsql-mysql.el +++ b/emacsql-mysql.el @@ -1,5 +1,16 @@ ;;; emacsql-mysql.el --- back-end for MySQL -*- lexical-binding: t; -*- +;; This is free and unencumbered software released into the public domain. + +;; Author: Christopher Wellons <well...@nullprogram.com> +;; URL: https://github.com/skeeto/emacsql +;; Version: 1.0.0 +;; Package-Requires: ((emacs "24.3") (cl-lib "0.3") (emacsql "1.0.2")) + +;;; Commentary: + +;; This backend uses the standard "mysql" command line program. + ;;; Code: (require 'cl-lib) diff --git a/emacsql-psql.el b/emacsql-psql.el index 15a316e8be..28233502e0 100644 --- a/emacsql-psql.el +++ b/emacsql-psql.el @@ -1,5 +1,19 @@ ;;; emacsql-psql.el --- back-end for PostgreSQL via psql -*- lexical-binding: t; -*- +;; This is free and unencumbered software released into the public domain. + +;; Author: Christopher Wellons <well...@nullprogram.com> +;; URL: https://github.com/skeeto/emacsql +;; Version: 1.0.0 +;; Package-Requires: ((emacs "24.3") (cl-lib "0.3") (emacsql "1.0.2") (pg "0.12")) + +;;; Commentary: + +;; This backend uses the standard "psql" command line program. + +;; This package also includes the emacsql-pg backend, which is written +;; in in pure Emacs Lisp and requires no command line program. + ;;; Code: (require 'cl-lib) diff --git a/emacsql-sqlite.el b/emacsql-sqlite.el index 2abf63bd3d..b9beb47750 100644 --- a/emacsql-sqlite.el +++ b/emacsql-sqlite.el @@ -1,5 +1,20 @@ ;; emacsql-sqlite.el --- back-end for SQLite -*- lexical-binding: t; -*- +;; This is free and unencumbered software released into the public domain. + +;; Author: Christopher Wellons <well...@nullprogram.com> +;; URL: https://github.com/skeeto/emacsql +;; Version: 1.0.0 +;; Package-Requires: ((emacs "24.3") (cl-lib "0.3") (emacsql "1.0.2")) + +;;; Commentary: + +;; During package installation EmacSQL will attempt to compile a +;; custom native binary for communicating with a SQLite database. If +;; this fails (a C compiler is not available), it will attempt to +;; download, with permission, a pre-built binary when the first +;; database connection is attempted. + ;;; Code: (require 'cl-lib) diff --git a/emacsql.el b/emacsql.el index 1051ad5387..e1357ebadb 100644 --- a/emacsql.el +++ b/emacsql.el @@ -5,29 +5,22 @@ ;; Author: Christopher Wellons <well...@nullprogram.com> ;; URL: https://github.com/skeeto/emacsql ;; Version: 1.0.2 -;; Package-Requires: ((emacs "24.3") (cl-lib "0.3") (finalize "1.0.0") (pg "0.12")) +;; Package-Requires: ((emacs "24.3") (cl-lib "0.3") (finalize "1.0.0")) ;;; Commentary: ;; EmacSQL is a high-level Emacs Lisp front-end for SQLite ;; (primarily), PostgreSQL, MySQL, and potentially other SQL -;; databases. +;; databases. On MELPA, each of the backends is provided through +;; separate packages: emacsql-sqlite, emacsql-psql, emacsql-mysql. -;; During package installation EmacSQL will attempt to compile a -;; custom native binary for communicating with a SQLite database. If -;; this fails (a C compiler is not available), it will attempt to -;; download, with permission, a pre-built binary when the first -;; database connection is attempted. +;; Most EmacSQL functions operate on a database connection. For +;; example, a connection to SQLite is established with +;; `emacsql-sqlite'. For each such connection a sqlite3 inferior +;; process is kept alive in the background. Connections are closed +;; with `emacsql-close'. -;; Most EmacSQL functions operate on a database connection. A -;; connection to SQLite is established with `emacsql-connect'. For -;; each such connection a sqlite3 inferior process is kept alive in -;; the background. Connections are closed with `emacsql-close'. - -;; (defvar db (emacsql-connect "company.db")) - -;; Other types of database connections are available (PostgreSQL via -;; `emacsql-psql'). +;; (defvar db (emacsql-sqlite "company.db")) ;; Use `emacsql' to send an s-expression SQL statements to a connected ;; database. Identifiers for tables and columns are symbols. SQL @@ -231,10 +224,6 @@ specific error conditions." ;;; Useful macros -(require 'emacsql-sqlite) ; for `emacsql-connect' - -(defalias 'emacsql-connect 'emacsql-sqlite) - (defmacro emacsql-with-connection (connection-spec &rest body) "Open an EmacSQL connection, evaluate BODY, and close the connection. CONNECTION-SPEC establishes a single binding.