emacs-orgmode
[Top][All Lists]
Advanced

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

Add 'readonly' option to ob-sqlite


From: Daniel M. German
Subject: Add 'readonly' option to ob-sqlite
Date: Thu, 06 Jun 2024 23:47:31 -0700
User-agent: mu4e 1.12.0; emacs 29.3


hi everybody,

Sometimes I think it is useful to open a DB in readonly mode

eg. to avoid modifying by mistake

This is a patch to ob-sqlite.el to accomplish that

It adds support for opening a sqlite database in readonly only.

It does it by adding a babel parameter readonly. If present, the
database will be opened in readonly mode. Example:

#+begin_src sqlite :readonly :db /tmp/rip.db
insert into a values (1,2);
select * from a;
#+end_src

This will result in the following error:

Runtime error near line 2: attempt to write a readonly database (8)
[ Babel evaluation exited with code 1 ]

Attachment: 0001-ob-sqlite.el-add-a-new-parameter-called-readonly.patch
Description: Text Data



--
Daniel M. German                  "A machine --computer-- can only do
   Lady Lovelace ->                what we tell it to do"
http://turingmachine.org/
http://silvernegative.com/
dmg (at) uvic (dot) ca
replace (at) with @ and (dot) with .


reply via email to

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