2 ms·
Cool fact you might not know: SQLite has direct support for “SQLite archives” (i.e. an SQLite database containing a conventional table of {file metadata, BLOB d
by derefr 8y ago
Cool fact you might not know: SQLite has direct support for “SQLite archives” (i.e. an SQLite database containing a conventional table of {file metadata, BLOB data} records representing archived files) built into its CLI client. This functionality lives under the `sqlite ar` subcommand, which exposes similar command-line functionality to tar(1).
Read more at: https://www.sqlite.org/sqlar.html https://www.sqlite.org/sqlar.html
The nice thing about this is that, since this “sqlar” table is just one table in the file, and the commands work whether or not other such tables exist, a file can be an “SQLite archive” while also being a regular SQLite database containing other tables at the same time. It’s sort of like how Fireworks used to add special chunks to PNG—the file was still a PNG, but now it was also a Fireworks project. (But, in this case, the “chunks” aren’t opaque binaries, but rather are SQL tables you can manipulate using regular SQL queries.)
And, of course, the SQLar “standard” isn’t all that complex—it’s designed so that you can easily construct your own SQLite archive files just by issuing regular DDL+DML queries through the SQLite binding of your language of choice. (Though, if you want support for inserting files compressed—which the `sqlite ar` command supports extracting—you’ll need a zlib binding as well.)