aboutsummaryrefslogtreecommitdiffstats
path: root/src/sqlite.c
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-12-13 06:08:09 +0100
committerLars Ingebrigtsen2021-12-13 06:08:09 +0100
commit9ce0fe5ef4d6e9c3dcd69237e0b5bb3fd46ee7da (patch)
treef7fa90b7e601558dc3caa0bb1c46deb88b199b2d /src/sqlite.c
parentc86b86f9a9ee3c42aed9ede794e8c3e19ce35ec5 (diff)
downloademacs-9ce0fe5ef4d6e9c3dcd69237e0b5bb3fd46ee7da.tar.gz
emacs-9ce0fe5ef4d6e9c3dcd69237e0b5bb3fd46ee7da.zip
Add a new `sqlite-pragma' command
* doc/lispref/text.texi (Database): Document it. * src/sqlite.c (Fsqlite_pragma): Add a separate command for pragmas. These can be done via sqlite-execute, but it's less confusing to have them in a separate command.
Diffstat (limited to 'src/sqlite.c')
-rw-r--r--src/sqlite.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sqlite.c b/src/sqlite.c
index 38e939cd84a..4968ce3f690 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -574,6 +574,17 @@ DEFUN ("sqlite-rollback", Fsqlite_rollback, Ssqlite_rollback, 1, 1, 0,
574 return sqlite_exec (XSQLITE (db)->db, "rollback"); 574 return sqlite_exec (XSQLITE (db)->db, "rollback");
575} 575}
576 576
577DEFUN ("sqlite-pragma", Fsqlite_pragma, Ssqlite_pragma, 2, 2, 0,
578 doc: /* Execute PRAGMA in DB. */)
579 (Lisp_Object db, Lisp_Object pragma)
580{
581 check_sqlite (db, false);
582 CHECK_STRING (pragma);
583
584 return sqlite_exec (XSQLITE (db)->db,
585 SSDATA (concat2 (build_string ("PRAGMA "), pragma)));
586}
587
577#ifdef HAVE_SQLITE3_LOAD_EXTENSION 588#ifdef HAVE_SQLITE3_LOAD_EXTENSION
578DEFUN ("sqlite-load-extension", Fsqlite_load_extension, 589DEFUN ("sqlite-load-extension", Fsqlite_load_extension,
579 Ssqlite_load_extension, 2, 2, 0, 590 Ssqlite_load_extension, 2, 2, 0,
@@ -689,6 +700,7 @@ syms_of_sqlite (void)
689 defsubr (&Ssqlite_transaction); 700 defsubr (&Ssqlite_transaction);
690 defsubr (&Ssqlite_commit); 701 defsubr (&Ssqlite_commit);
691 defsubr (&Ssqlite_rollback); 702 defsubr (&Ssqlite_rollback);
703 defsubr (&Ssqlite_pragma);
692#ifdef HAVE_SQLITE3_LOAD_EXTENSION 704#ifdef HAVE_SQLITE3_LOAD_EXTENSION
693 defsubr (&Ssqlite_load_extension); 705 defsubr (&Ssqlite_load_extension);
694#endif 706#endif