SQLite Forum

Extract files from sqlar with a directory prepended
Login
> It gives you the actual paths extracted, to be printed with --verbose.

What do you mean? I don't see how to print the first `($dir || name)`.

~~~
$ sqlite3 --verbose test.sqlar -Axn
sqlite3: Error: unknown option: -verbose
Use -help for a list of options.
~~~

How to run the SQL commands in an sqlite3 session without using `-Ax`. I tried the following. But no files are written.

~~~
$ sqlite3 test.sqlar
SQLite version 3.35.5 2021-04-19 18:32:05
Enter ".help" for usage hints.
sqlite> SELECT  ($dir || name), writefile(($dir || name), sqlar_uncompress(data, sz), mode, mtime) FROM sqlar WHERE (1) AND (data IS NULL OR $dirOnly = 0);
sqlite>
~~~