emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] ob-sqlite: Use a transient in-memory database by default


From: Max Nikulin
Subject: Re: [PATCH] ob-sqlite: Use a transient in-memory database by default
Date: Wed, 3 May 2023 23:32:14 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0

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

[Prev in Thread] Current Thread [Next in Thread]