by michalc on 12/27/23, 8:05 PM with 14 comments
by ncruces on 12/28/23, 9:21 AM
I'm also curious what use cases you had in mind. My SQLite wrapper reimplements the memdb [2] VFS mostly as an exercise of the VFS API, but it provides a few additional niceties. The backing memory doesn't need to be contiguous, nor is it copied when the DB grows/shrinks. This makes it possible to have significantly larger in memory DBs. I also make it easy to bootstrap the database from (e.g.) a file on disk, or data embed in the binary. It's not as easy, however, to access the DB bytes after the DB goes “live.”
[1] https://www3.sqlite.org/src/file?name=src/memdb.c
[2] https://pkg.go.dev/github.com/ncruces/go-sqlite3/vfs/memdb#s...
by gxt on 12/28/23, 2:50 AM
by up2isomorphism on 12/28/23, 6:33 AM
by throwaway81523 on 12/28/23, 5:08 AM
conn = sqlite3.connect('%MEMORY%')
Is there more to it than that?