Max Nikulin <maniku...@gmail.com> writes:

>> 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.

We can simply display a warning when :db is not specified. Something
like

"ob-sql: :db header argument not specified.  Using in-memory database"

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to