How to run several commands in one post

Wednesday, 21 May 2014 · 4 messages · last reply 18 Jun 2014
AL
Arjan Loeffen21 May 2014 19:05 #
Dear BaseX people I'd like to run several commands in a single post. Example:
OPEN TEST
CREATE INDEX ATTRIBUTE
CREATE INDEX TEXT
CREATE INDEX FULLTEXT
OPTIMIZE ALL
CLOSE
My request is:
<command>
 <text>
    the commands above
 </text>
</command>
But it seems this cannot be done. I get the error: Stopped at ., 1/10: Syntax: OPEN [name] ([path]) Open database. Opens the database [name], filtered by [path]. Is it possible, and if so, what should I change?
-- Arjan Loeffen, Armatiek BV 06-12918997
CG
Christian Grün21 May 2014 19:11 #
Hi Arjan, currently, via REST, only one command at a time can be processed. I have come across an old GitHub issue that was related to your request, and I've just reopened it [1]. Hope this helps, Christian [1] https://github.com/BaseXdb/basex/issues/559
Quoted text · Arjan Loeffen · 31 lines
On Wed, May 21, 2014 at 7:05 PM, Arjan Loeffen <arjan.loeffen at armatiek.nl> wrote: > Dear BaseX people > > I'd like to run several commands in a single post. Example: > > OPEN TEST > CREATE INDEX ATTRIBUTE > CREATE INDEX TEXT > CREATE INDEX FULLTEXT > OPTIMIZE ALL > CLOSE > > My request is: > <command> > <text> > the commands above > </text> > </command> > > But it seems this cannot be done. I get the error: > > Stopped at ., 1/10: > Syntax: OPEN [name] ([path]) > Open database. Opens the database [name], filtered by [path]. > > Is it possible, and if so, what should I change? > > -- > Arjan Loeffen, Armatiek BV > 06-12918997
CG
Christian Grün22 May 2014 10:44 #
Hi Arjan (cc to the list),
Quoted text · Christian Grün · 1 line
>> But then it is also not possible to start-up some existing server side script that way?
I've added another idea to the reopened GitHub issue [1]: we could extend the "run" operation [2] to also support command scripts. Christian [1] https://github.com/BaseXdb/basex/issues/559 [2] http://docs.basex.org/wiki/REST#Operations
CG
Christian Grün18 Jun 2014 14:20 #
Hi Arjan,
Quoted text · Christian Grün · 2 lines
> I've added another idea to the reopened GitHub issue [1]: we could > extend the "run" operation [2] to also support command scripts.
The latest snapshot now provides this feature [3]: the "run" operation can be used to specify command scripts, which can (by nature) contain multiple commands. The new feature will also be available in BaseX 7.9 (to be released soon). Hope this helps, Christian [1] https://github.com/BaseXdb/basex/issues/559 [2] http://docs.basex.org/wiki/REST#Operations [3] http://files.basex.org/releases/latest/

⚡Generated with XQuery