mc/misc/ext.d
Dima Gerasimov ebbdc8847e Ticket #4369: sqlite 3 view: use 'immutable=1' URI parameter
...to prevent leaving wal/shm files after viewing sqlite database.

The problem I often had with viewing .sqlite files with mc is that
exiting the view mode mid-way may leave .wal/.shm files in the database
directory.

This never caused any actual issues, but a bit annoying, since leftover
.wal files are often a sign that the program working with the database
exited ungracefully.

This effectively reproduces mc's behaviour:

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "/tmp/testsqlite/db file.sqlite" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'
    'db file.sqlite-shm'
    'db file.sqlite-wal'

After the change -- no shm/wal files

    /tmp/testsqlite $ rm -f *-wal *-shm && sqlite3 "file:/tmp/testsqlite/db file.sqlite?immutable=1" .dump | head >/dev/null && ls -1 /tmp/testsqlite/
    'db file.sqlite'

You can find the docs on immutable mode here:
https://www.sqlite.org/uri.html#uriimmutable

Immutable mode has been supported in sqlite since 2014:
https://www.sqlite.org/changes.html#version_3_8_5

In case user's sqlite installation is older, the mode is just quietly
ignored, so the change is backwards compatible.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
2022-05-01 09:46:39 +03:00
..
Makefile.am Ticket #2751: Support *.lib artifacts generated by gputils utility 2012-06-12 14:35:48 +03:00
archive.sh Ticket #4100: extfs vfs: support of WIM archive (image). 2020-10-29 16:58:36 +03:00
doc.sh.in Ticket #4167: clarify e-books support. 2021-02-19 16:53:11 +03:00
image.sh Ticket #4127: several improvements to mc.ext and syntax highlighting. 2020-10-10 15:55:42 +03:00
misc.sh.in Ticket #4369: sqlite 3 view: use 'immutable=1' URI parameter 2022-05-01 09:46:39 +03:00
package.sh Ticket #3574: fix XDG silent open in background. 2016-02-14 08:45:58 +03:00
sound.sh Ticket #4167: use mediainfo to view info about various media files. 2021-02-19 16:57:01 +03:00
text.sh.in Ticket #3906: ZSTD support. 2018-03-19 15:00:23 +03:00
video.sh Ticket #4127: several improvements to mc.ext and syntax highlighting. 2020-10-10 15:55:42 +03:00
web.sh.in Ticket #4030: misc/ext.d/web.sh.in: view html: fallback to cat... 2019-12-15 12:53:20 +03:00