Re: [basex-talk] apply variable bindings to command scripts

2014-05-05 Thread Fabrice Etanchaud
Dear Christian,

That would be great !
In order to allow for parameters, do you think one could declare external 
variables before the commands element ?
Is it to say that a command file could be any xquery script generateding xml ?

Best regards,
Fabrice

-Message d'origine-
De : Christian Grün [mailto:christian.gr...@gmail.com] 
Envoyé : dimanche 4 mai 2014 22:08
À : Fabrice Etanchaud
Cc : basex-talk@mailman.uni-konstanz.de
Objet : Re: [basex-talk] apply variable bindings to command scripts

Hi Fabrice,

I'm still hesitant to introduce more features to the command script syntax, as 
all of them will be BaseX-specific. But we could interpret all input as XQuery 
and execute the resulting XML as BaseX commands.
This way, we could write things like..

  commands{
for $n in 1 to 10
return create-db name='db{ $n }'/
  }/commands

What do you think?
Christian



On Mon, Apr 14, 2014 at 11:44 AM, Christian Grün christian.gr...@gmail.com 
wrote:
 Hi Fabrice,

 I've recorded your feature request in a new issue:

   https://github.com/BaseXdb/basex/issues/929

 Christian



 On Fri, Apr 11, 2014 at 3:57 PM, Fabrice Etanchaud 
 fetanch...@questel.com wrote:
 Dear all,



 Currently, in order to obtain tailored command scripts, I found the 
 following solution :



 A template test.bxs file :



 commands

   open name='${DBNAME}'/

   xquery

 ![CDATA[

 (/document)[1]

 ]]

   /xquery

   close/

 /commands



 A bash script test.sh:



 #!/bin/bash



 DBNAME=de-dpma-u-meta



 eval cat EOF

 $($1)

 EOF

  | basex -c-



 And then call :



 ./test.sh test.bxs





 Could it be possible for the variable bindings to be applied also to 
 script commands,

 So basex  -bDBNAME=de-dpma-u-meta  test.bxs

 does the whole job ?



 that would work also for commands' sequences like :

 set option='bindings'.

 execute or run



 Merci !



 Best regards,

 Fabrice


[basex-talk] 7.8 MAINMEM option

2014-05-05 Thread Maximilian Gärber
Hi,

I am running some queries against file based and main-memory dbs for comparison.

Creating the main-memory db via xquery (declare option or pragma) did
not work: declare option db:mainmem 'true'; or (# db:mainmem true #)
Via command line it works: set mainmem true

Only the db won't be listed and seems to be dropped after I open
another db on the command line. I had expected the main-memory db to
be treated like other dbs (e.g. being there as long as I don't drop it
or stop the server)

Is this behaviour on purpose?

Regards,

Max