Commit graph

9 commits

Author SHA1 Message Date
F. Jason Park
db5915f30b Fix 'with-sqlite-transaction'
* lisp/sqlite.el (with-sqlite-transaction): Tuck misplaced body
of else form back into feature-test control structure whence it
escaped.  (Bug#67142)

* test/lisp/sqlite-tests.el: New file to accompany
test/src/sqlite-tests.el.
2024-03-11 15:23:55 +02:00
Po Lu
8e1c56ae46 ; Add 2024 to copyright years 2024-01-02 09:47:10 +08:00
Eli Zaretskii
e6ad97a333 Fix byte-compilation warnings about 'sqlite-rollback'
* lisp/sqlite.el (sqlite-transaction, sqlite-commit)
(sqlite-rollback): Declare.
* lisp/emacs-lisp/multisession.el (sqlite-commit)
(sqlite-transaction): Remove declaration.
2023-11-24 09:30:53 +02:00
Eli Zaretskii
d72a4ed65c Fix 'with-sqlite-transaction' when BODY fails
* lisp/sqlite.el (with-sqlite-transaction): Don't commit changes
if BODY errors out.  Roll back the transaction if committing
fails.  (Bug#67142)

* etc/NEWS:
* doc/lispref/text.texi (Database): Document the error handling in
'with-sqlite-transaction'.
2023-11-21 15:36:22 +02:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Eli Zaretskii
823b6b8d26 ; Add 2022 to copyright years. 2022-01-01 07:07:15 -05:00
Lars Ingebrigtsen
e52739c32f Make with-sqlite-transaction mode code efficient
* lisp/sqlite.el (with-sqlite-transaction): Rewrite to only
include BODY once.
2021-12-12 07:22:49 +01:00
Lars Ingebrigtsen
7364b60fe9 Fix comment in heading 2021-12-11 05:22:42 +01:00
Lars Ingebrigtsen
3d38d1d134 Add sqlite3 support to Emacs
* configure.ac: Add check for the sqlite library.
* doc/lispref/text.texi (Database): Document it.

* lisp/sqlite.el: New file.

* lisp/term/w32-win.el (dynamic-library-alist): Add a mapping.

* src/Makefile.in (SQLITE3_LIBS): Add the libraries.

* src/alloc.c (union emacs_align_type): Add a Lisp_Sqlite struct.

* src/data.c (Ftype_of): Add sqlite.

* src/emacs.c (main): Load the syms.

* src/lisp.h (DEFINE_GDB_SYMBOL_BEGIN): Add PVEC_SQLITE.
(GCALIGNED_STRUCT): New struct to keep data for sqlite database
objects and statement objects.
(SQLITEP, SQLITE, CHECK_SQLITE, XSQLITE): New macros for accessing
the objects.

* src/pdumper.c (dump_vectorlike): Update hash.
(dump_vectorlike): Don't dump it.

* src/print.c (print_vectorlike): Add a printer for the sqlite
object.

* src/sqlite.c: New file.

* test/src/sqlite-tests.el: Add tests.
2021-12-11 04:55:57 +01:00