Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparing to release 4.1.0 #126

Closed
tarsius opened this issue Nov 17, 2024 · 1 comment
Closed

Preparing to release 4.1.0 #126

tarsius opened this issue Nov 17, 2024 · 1 comment

Comments

@tarsius
Copy link
Member

tarsius commented Nov 17, 2024

4.0.0 was released on 2024-08-08. It added two new SQLite back-ends, emacsql-sqlite-builtin and emacsql-sqlite-module.

The upcoming 4.1.0 release removes the legacy emacsql-sqlite back-end, which used our own custom SQLite binary. Using an external process like this is must slower and less reliable than using the new back-ends, which use the new built-in SQLite support in Emacs 29.1 or the module provided by the third-party sqlite3 package.

When I first announced my plans for 4.0.0 in #113, 18 months ago, I asked package authors to start using the emacsql-sqlite-open function, instead of hard-coding which SQlite is used or providing their own mechanism for picking a back-end.

If you haven't done that yet, then you have to do so now. The old emacsql-sqlite back-end has already been removed from EmacSQL's main branch, and if you are still using that explicitly, your package is now broken. But even if your package uses one of the new back-ends by default, you should make sure users do not have the option to pick the now removed emacsql-sqlite back-end or one of the old inferior third-party back-ends, which are also not supported anymore.

I have just added a new emacsql-sqlite-connection function to further reduce the required boilerplate. Most packages should now only need:

(require 'emacsql-sqlite)

(defvar my-database-file "/tmp/foo2/my.db")
(defvar my-database-connection nil)

(defun my-db--init (connection)
  (emacsql connection [:create-table people ([name id salary])]))

(defun my-db ()
  (emacsql-sqlite-connection 'my-database-connection my-database-file
                             #'my-db--init))

After that you can use (emacsql (my-db) [...] ...). You might want to reduce the required typing to just (my-sql [...] ...), by adding:

(defun my-sql (sql &rest args)
  (apply #'emacsql (my-db) sql args))

If your package uses more than a single database, then you have to use emacsql-sqlite-open. But look at emacsql-sqlite-connection anyway; most likely you can just copy that and make some minor adjustments.

To be able to use emacsql-sqlite-open or emacsql-sqlite-connection, you have to (require 'emacsql-sqlite).

If your package currently does (require 'emacsql-sqlite-common), that will continue to work but only for another release or two. That library does nothing now but (require emacs-sqlite), so please change that as soon as 4.1.0 is released.

@tarsius tarsius pinned this issue Nov 18, 2024
@tarsius
Copy link
Member Author

tarsius commented Dec 1, 2024

Freshly released.

@tarsius tarsius closed this as completed Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant