Hi Britney,
tgz are currently only supported when creating new databases. As you have already seen, the REPLACE command (or db:replace) is used to replace single resources.
One workaround is to extract your archive via standard command-line tools and replace the files with XQuery:
let $tmp-dir := 'tmp/' let $tgz-file := 'xml.tgz' return ( file:create-dir($tmp-dir), prof:dump(proc:system('tar', ('-zxvf', $tgz-file, '-C', $tmp-dir))), for $file in file:list($tmp-dir, true(), '*.xml') return db:replace('db', $file, doc($tmp-dir || $file)), file:delete($tmp-dir, true()) )
In future, I may add tar support to our archive module [1].
Hope this helps, Christian
[1] http://docs.basex.org/wiki/Archive_Module
On Mon, Aug 21, 2017 at 6:43 PM, Britney Fox britfox42@hotmail.com wrote:
Hi,
I would like to use BaseX for a database and the daily updates are .tar.gz files which inlude .xml inside directories.
Of course, the directories need to match the ones inside the database.
Unfortunately, the BaseX REPLACE command absolutly need a path so it makes the update fail since the path is added.
So, is there a solution using BaseX ?
Thanks.