[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sqlite3 95abc25cc6 48/62: package name: sqlite3-api to sql
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sqlite3 95abc25cc6 48/62: package name: sqlite3-api to sqlite3 |
Date: |
Tue, 14 Mar 2023 11:01:48 -0400 (EDT) |
branch: elpa/sqlite3
commit 95abc25cc67d652ce2ba79907224e581aef62e93
Author: Uphill Battler <code@uphill.me>
Commit: Uphill Battler <code@uphill.me>
package name: sqlite3-api to sqlite3
---
.gitignore | 2 +-
Makefile | 10 +++----
README.org | 79 +++++++++++++++++++++++++++++++++++++----------------
tests/regression.el | 2 +-
4 files changed, 63 insertions(+), 30 deletions(-)
diff --git a/.gitignore b/.gitignore
index 2478bd3050..ddcd3a3c1b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,4 @@
sqlite3-napi-module-with-create-function.c
xxx.el
**/sqlite3-api-*
-consts.c
\ No newline at end of file
+**/sqlite3-*
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 052061bbff..fec86eb21c 100644
--- a/Makefile
+++ b/Makefile
@@ -12,25 +12,25 @@ CFLAGS ?= -g3 -Wall -std=c99 $(INC)
EMACS ?= /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
# Melpa package
-PKG=sqlite3-api
+PKG=sqlite3
# dynamic module package
MODULE=$(PKG)
-MODULE_VERSION=0.14
+MODULE_VERSION=0.15
MODULE_BASENAME=$(MODULE)-$(MODULE_VERSION)
MODULE_PKG_EL=$(MODULE_BASENAME)/$(MODULE)-pkg.el
MODULE_TAR=$(MODULE_BASENAME).tar
-all: $(MODULE).so
+all: $(MODULE)-api.so
clean:
rm -rf *.so *.o *.tar $(MODULE_BASENAME)
# File "MODULE" is read by (sqlite3-api-install-dynamic-module)
# during installation
-module: $(MODULE).so
+module: $(MODULE)-api.so
mkdir -p $(MODULE_BASENAME)
- cp $(MODULE).so $(MODULE_BASENAME)
+ cp $(MODULE).el $(MODULE)-api.so $(MODULE_BASENAME)
echo "(define-package \"$(MODULE)\" \"$(MODULE_VERSION)\" \"SQLite3 API
dynamic module\")" > $(MODULE_PKG_EL)
tar cvf $(MODULE_TAR) $(MODULE_BASENAME)
diff --git a/README.org b/README.org
index 89dd710617..aa10efbe4a 100644
--- a/README.org
+++ b/README.org
@@ -1,9 +1,10 @@
#+OPTIONS: ^:nil
* SQLite3 API for Emacs 25+
-~sqlite3-api~ is a dynamic module for GNU Emacs 25+ that provides
-direct access to the core SQLite3 C API from Emacs Lisp.
-#+BEGIN_SRC emacs-lisp :eval no :exports code
-(require 'sqlite3-api)
+** Introduction
+ ~sqlite3~ is a dynamic module for GNU Emacs 25+ that provides
+ direct access to the core SQLite3 C API from Emacs Lisp.
+ #+BEGIN_SRC emacs-lisp :eval no :exports code
+(require 'sqlite3)
(setq dbh (sqlite3-open "person.sqlite3" sqlite-open-readwrite
sqlite-open-create))
(sqlite3-exec dbh "create table temp (name text, age integer)")
@@ -22,14 +23,14 @@ direct access to the core SQLite3 C API from Emacs Lisp.
(message "name: %s, age: %d" name age)))
(sqlite3-finalize stmt)
(sqlite3-close dbh)
-#+END_SRC
+ #+END_SRC
-While this module provides only 14 functions (vs
[[https://sqlite.org/c3ref/funclist.html][200+ in the C API]]), it should
satisfy most
-users' needs.
+ While this module provides only 14 functions (vs
[[https://sqlite.org/c3ref/funclist.html][200+ in the C API]]), it should
satisfy most
+ users' needs.
-The current version is v0.14.
+ The current version is v0.15.
-This is an alpha release so it might crash your Emacs. Save your work before
you try it out!
+ This is an alpha release so it might crash your Emacs. Save your work before
you try it out!
** Table of Contents
:PROPERTIES:
@@ -40,10 +41,12 @@ This is an alpha release so it might crash your Emacs. Save
your work before you
# Requires https://github.com/alphapapa/org-make-toc
:CONTENTS:
- [[#sqlite3-api-for-emacs-25][SQLite3 API for Emacs 25+]]
+ - [[#introduction][Introduction]]
- [[#requirements][Requirements]]
- [[#installation][Installation]]
+ - [[#melpa][Melpa]]
+ - [[#local-package][Local Package]]
- [[#manual][Manual]]
- - [[#package][Package]]
- [[#api][API]]
- [[#sqlite3-open][sqlite3-open]]
- [[#sqlite3-close][sqlite3-close]]
@@ -71,35 +74,44 @@ This is an alpha release so it might crash your Emacs. Save
your work before you
:END:
** Requirements
-- Emacs 25.1 or above, compiled with module support (~./configure
--with-modules~)
+- Emacs 25.1 or above, compiled with module support (~./configure
+ --with-modules~). Emacs 27.1 supports dynamic modules by default unless you
+ explicitly disable it.
- SQLite3 v3.16.0 or above. Older versions might work but I have not
personally tested those.
- A C99 compiler
It's been tested on macOS (Catalina) and CentOS 7.
** Installation
-*** Manual
-#+BEGIN_SRC sh :eval no :exports code
-$ git co https://github.com/pekingduck/emacs-sqlite3-api
-$ cd emacs-sqlite3-api
-$ make
-$ cp sqlite3-api.so /your/elisp/load-path/
+*** Melpa
+You can now install the package via Melpa (package name: ~sqlite3~).
+
+The first time you ~(require 'sqlite3)~, you will be asked to confirm the
+compilation of the dynamic module:
+
+#+BEGIN_SRC text :eval no :exports code
+sqlite3-api module must be build. Do so now?
#+END_SRC
-*** Package
+After the module is successfully compiled, you should ~(unload-feature
+'sqlite3)~ and then ~(require sqlite3)~ to reload properly.
+
+You can ~(eval sqlite-ok)~ to test the installation. You should get a 0.
+
+*** Local Package
#+BEGIN_SRC sh :eval no :exports code
$ git co https://github.com/pekingduck/emacs-sqlite3-api
$ cd emacs-sqlite3-api
$ make module
#+END_SRC
-A tar archive called ~sqlite3-api-X.Y.tar~ will be created. Do a ~M-x
package-install-file~ in Emacs to install that tar archive and
+A tar archive called ~sqlite3-X.Y.tar~ will be created. Do a ~M-x
package-install-file~ in Emacs to install that tar archive and
you're all set.
For Mac users:
#+BEGIN_SRC sh :eval no :exports code
$ make HOMEBREW=1
#+END_SRC
-to build the module against sqlite3 installed by homebrew.
+to build the module against sqlite3 installed by Homebrew.
If you have sqlite3 installed in a nonstandard location:
#+BEGIN_SRC sh :eval no :exports code
@@ -111,11 +123,27 @@ Currently there's no way to reload a dynamic module in
Emacs
If you are updating from an older version, you'll need to restart Emacs
for the new module to take effect.
+2020-09-16 Update: I can't find it in ~etc/NEWS~, but it seems Emacs 27.1
+supports unloading of dynamic modules. To unload ~sqlite3~ properly:
+
+#+BEGIN_SRC emacs-lisp :eval no :exports code
+(unload-feature 'sqlite3)
+(unload-feature 'sqlite3-api)
+#+END_SRC
+
+*** Manual
+#+BEGIN_SRC sh :eval no :exports code
+$ git co https://github.com/pekingduck/emacs-sqlite3-api
+$ cd emacs-sqlite3-api
+$ make
+$ cp sqlite3.el sqlite3-api.so /your/elisp/load-path/
+#+END_SRC
+
** API
To load the package, put the following in your ~.emacs~:
#+BEGIN_SRC emacs-lisp :eval no :exports code
-(require 'sqlite3-api)
+(require 'sqlite3)
#+END_SRC
An application will typically use sqlite3_open() to create a single database
connection during initialization.
@@ -128,7 +156,9 @@ To run an SQL statement, the application follows these
steps:
1. Destroy the prepared statement using sqlite3_finalize().
1. Close the database using sqlite3_close().
-[[https://www.sqlite.org/rescode.html][SQlite3 constants]], defined in
sqlite3.h, are things such as numeric result codes from various interfaces (ex:
~SQLITE_OK~) or flags passed into functions to control behavior (ex:
~SQLITE_OPEN_READONLY~).
+[[https://www.sqlite.org/rescode.html][SQlite3 constants]], defined in
sqlite3.h, are things such as numeric result codes
+from various interfaces (ex: ~SQLITE_OK~) or flags passed into functions to
+control behavior (ex: ~SQLITE_OPEN_READONLY~).
In elisp they are in lowercase and words are separated by "-" instead of
"_". For example, ~SQLITE_OK~ would be ~sqlite-ok~.
@@ -324,7 +354,7 @@ Use ~sqlite3-exec~ to start, commit and rollback a
transaction:
#+END_SRC
See Error Handling below on how to use the
[[https://www.gnu.org/software/emacs/manual/html_node/elisp/Handling-Errors.html][condition-case]]
form to handle rollback.
** Error Handling
-Currently two error symbols are defined in ~sqlite3-api.el~:
+Currently two error symbols are defined in ~sqlite3.el~:
1. ~sql-error~ is raised by ~sqlite3-prepare~
2. ~db-error~ is raised by ~sqlite3-open~ and ~sqlite3-exec~
@@ -358,6 +388,9 @@ The code is licensed under the
[[https://www.gnu.org/licenses/gpl-3.0.html][GNU
** Contributors
- [[https://github.com/tarsius][Jonas Bernoulli]] - Melpa package
** Changelog
+*v0.15 - 2020-09-16*
+- Fixed a bug in ~sqlite3-bind-multi~ under Emacs 27.1
+
*v0.14 - 2020-07-08*
- Added sqlite3.el (melpa)
diff --git a/tests/regression.el b/tests/regression.el
index b54b140c72..22ce48a3de 100644
--- a/tests/regression.el
+++ b/tests/regression.el
@@ -14,7 +14,7 @@
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;
-(require 'sqlite3-api)
+(require 'sqlite3)
(require 'cl-lib)
(ert-deftest sqlite3-test-create-db ()
- [nongnu] elpa/sqlite3 5218e49511 41/62: Merge pull request #2 from tarsiiformes/melpa, (continued)
- [nongnu] elpa/sqlite3 5218e49511 41/62: Merge pull request #2 from tarsiiformes/melpa, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 94108288e4 08/62: fixed README, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 a4832b01c3 14/62: improved commentary, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 89512b336a 23/62: removed package-install.el & install.el, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 0d4ca93830 33/62: Removed gcc warnings, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 800a4fc494 40/62: Add sqlite3.el to make installable from Melpa, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 fd4188756e 45/62: Fixed inlined src blocks, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 40e3c9b6a8 61/62: Compile without prompting in non-interactive session, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 0cb2e25155 22/62: doc updated, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 84bd83a7fa 42/62: Removed unused codes from consts.c, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 95abc25cc6 48/62: package name: sqlite3-api to sqlite3,
ELPA Syncer <=
- [nongnu] elpa/sqlite3 88dfeae8f9 50/62: Merge pull request #3 from reflektoin/patch-1, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 7cb4b660fe 53/62: Update README.org, ELPA Syncer, 2023/03/14
- [nongnu] elpa/sqlite3 4e111c937f 54/62: fixed a bug in NIL equality check, ELPA Syncer, 2023/03/14