On 03/05/2023 22:12, Max Nikulin wrote:
On 03/05/2023 19:59, Rudolf Adamkovič wrote:
+++ b/lisp/ob-sqlite.el
...
-    (db (cdr (assq :db params)))
+    (db (or (cdr (assq :db params)) ":memory:"))

I am unsure what is better, to add a fallback here or to add :db ":memory" to the org-babel-default-header-args:sqlite variable.

Perhaps it is better to keep current behavior with error by default and just to recommend more prominently using file local header arguments

#+PROPERTY: header-args:sqlite :db ":memory"

Changing defaults is a compromise. Perhaps you mostly use src blocks as playground and in-memory database is really convenient for you. However missed :db file in a block creating tables may cause a *delayed* error that will happen on attempt to insert some data to these tables later. It is harder to figure out that :db parameter was forgotten several screens above. The cost of debugging might be higher than adding a property line to files where a user is experimenting with sqlite features.


Reply via email to