Data backends for ETAF applications; SQLite today
ext
  • Emacs Lisp 50.8%
  • Python 47.8%
  • Makefile 1.3%
  • Shell 0.1%
Find a file
Kinneyzhang 38f8724595
Some checks failed
Repository structure / structure (push) Has been cancelled
chore(scripts): sync shared workspace tooling
Copy the shared tooling maintained in the workspace root, as of
5de8e6457c52 feat(release): carry packages other authors build with ETAF:

- scripts/package_archive.py

Validation: workspace.py seal-sync found each copy identical to the
committed root tooling and kept this commit only after
check-repository.py --staged passed on it.
2026-10-22 13:15:58 +08:00
.githooks chore(git): enforce logical commits and structured messages 2026-09-13 11:15:14 +08:00
.github/workflows chore(scripts): sync shared workspace tooling 2026-10-13 01:37:26 +08:00
lisp chore: adopt the GitHub origin in links and tooling 2026-10-13 00:48:59 +08:00
scripts chore(scripts): sync shared workspace tooling 2026-10-22 13:15:58 +08:00
tests feat(sqlite): batch atomic writes and reconcile schema columns 2026-10-03 08:44:27 +08:00
.editorconfig chore: establish consistent repository and acceptance policy 2026-09-13 11:10:50 +08:00
.gitignore chore: establish consistent repository and acceptance policy 2026-09-13 11:10:50 +08:00
CHANGELOG.md docs(etaf-db): link the manual through its published site 2026-10-13 00:11:40 +08:00
etaf-db.el chore: adopt the GitHub origin in links and tooling 2026-10-13 00:48:59 +08:00
LICENSE chore: add the GPL-3.0 license 2026-10-13 00:48:59 +08:00
Makefile build(integration): remove retired TP load paths 2026-09-18 17:06:48 +08:00
README.md docs(etaf-db): link the manual through its published site 2026-10-13 00:11:40 +08:00
README.zh-CN.md docs(etaf-db): link the manual through its published site 2026-10-13 00:11:40 +08:00

ETAF DB

中文

etaf-db provides database backends for the ETAF framework. SQLite is the only currently implemented backend. It adapts Emacs' built-in SQLite support to etaf-data-source; ETAF core continues to own Data Controllers and reactive state.

Installation and use

Requires Emacs 29.1 or later with SQLite support and ETAF 0.2.1 or later. For a checkout, add the repository root and ETAF's dependency roots to load-path, then use (require 'etaf-db). Package archives include the root entry and lisp/. etaf-db.el documents the supported API. SQLite-specific constructors retain the etaf-sqlite-* prefix because their schema and storage arguments describe that backend.

(require 'etaf-db)

(let* ((table (etaf-sqlite-table
               'items
               (list (etaf-sqlite-column :id "id" :type 'integer :primary t)
                     (etaf-sqlite-column :name "name" :type 'text))
               :id))
       (database (etaf-sqlite-database "~/items.sqlite" table)))
  (etaf-sqlite-initialize database)
  (let ((controller (etaf-data-controller
                     (etaf-sqlite-source database) :auto-load t)))
    (unwind-protect
        (message "%S" (etaf-value (etaf-data-items controller)))
      (etaf-data-stop controller))))

The SQLite backend owns schema validation, short-lived connections, pagination, queries and synchronous mutations. Its source uses the existing ETAF Data Source contract. There is no separate database controller, ORM or backend dispatch protocol. Non-database integrations can implement the same source contract independently.

See the SQLite backend chapter of the ETAF Reference Manual for supported queries, writes and lifecycle, including the optional :mutate-v2 t source capability.

Development

Run make setup-hooks after cloning. make structure-check is the fast structure and API boundary gate. make check EMACS=/path/to/emacs adds compilation, entry validation and the public scenarios in tests/acceptance.json. make test runs those same correctness scenarios. GUI and performance acceptance use the consuming examples' separate workflows.