SQLite User Forum

Doc suggestion ATTACH and VFS
Login

Doc suggestion ATTACH and VFS

(1) By Roger Binns (rogerbinns) on 2025-01-21 15:46:07 [source]

The ATTACH documentation doesn't say it, but attached databases use the same VFS as the main database unless explicitly specified. This is especially surprising with memdb as it accepts any name.

Here is an example showing it happening.

sqlite> .open 'file:/shared?vfs=memdb'
sqlite> attach diskdb as diskdb;`
sqlite> .databases
main: "" r/w
diskdb: "" r/w
sqlite> detach diskdb;
sqlite> attach 'file:diskdb?vfs=unix' as diskdb;
sqlite> .databases
main: "" r/w
diskdb: /space/apsw/sqlite3/diskdb r/w

(2) By Stephan Beal (stephan) on 2025-01-21 16:01:43 in reply to 1 [link] [source]

The ATTACH documentation doesn't say it, but...

That's now documented but won't show up until the next time the site is rebuilt.

Thank you for the suggestion!