Copy between databases
Wednesday, 30 July 2014 · 4 messages · last reply 4 Aug 2014
ML
Marco Lettere30 Jul 2014 20:16 #
Hello all,
what is the best way to copy/move collections of resources from one db to another?
Thanks,
Marco.
Quoted text · 102 lines
Il 30/lug/2014 18:36 Marc van Grootel <marc.van.grootel at gmail.com> ha scritto: > Hi Dirk, > > Great. What a weird asymmetry though. At least there's a way to call it. > Thanks. > > > --Marc > > > > > On Wed, Jul 30, 2014 at 6:25 PM, Dirk Kirsten <dk at basex.org> wrote: > > > Hello Marc, > > > > > > > > URLEncoder has no public constructor, URLDecoder has. Using import to > > > > bind to Java, BaseX tries to create a new instance, which is not > > > > possible without a constructor. Use declare, i.e. > > > > > > > > declare namespace encoder = "java:java.net.URLEncoder"; > > > > > > > > to access static methods. > > > > > > > > Cheers, > > > > Dirk > > > > > > > > On 30/07/14 18:17, Marc van Grootel wrote: > > > > > Hi, > > > > > > > > > > What could be the reason that importing java.net.URLDecoder works as > > > > > expected but doing the same with java.net.URLEncoder doesn't. > > > > > > > > > > The following works: > > > > > > > > > > import module namespace decoder = "java.net.URLDecoder"; > > > > > decoder:decode('foo/bar%20baz') > > > > > > > > > > => 'foo/bar baz' > > > > > > > > > > This gives a "Could not instantiate module 'java.net.URLEncoder' > > > > > > > > > > import module namespace encoder = "java.net.URLEncoder"; > > > > > encoder:encode('foo/bar baz') > > > > > > > > > > --Marc > > > > > > > > > > > > > > > > > -- > > > > Dirk Kirsten, BaseX GmbH, http://basex.org > > > > |-- Firmensitz: Blarerstrasse 56, 78462 Konstanz > > > > |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: > > > > | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle > > > > `-- Phone: 0049 7531 28 28 676, Fax: 0049 7531 20 05 22 > > > > > > -- > --Marc
CG
Christian Grün4 Aug 2014 11:05 #
Hi Marco,
Quoted text · Marco Lettere · 2 lines
> what is the best way to copy/move collections of resources from one db to > another?
Here is one way to do it:
db:open('source', 'a') ! db:add('target', ., db:path(.))Cheers,
Christian
FE
Fabrice Etanchaud4 Aug 2014 11:27 #
Dear Christian,
Is data serialized/deserialized in your example,
Or is it working directly on the internal data format ?
Best regards,
Fabrice Etanchaud
Questel/Orbit
-----Message d'origine-----
Quoted text · Christian Grün · 12 lines
De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Christian Grün Envoyé : lundi 4 août 2014 11:06 À : Marco Lettere Cc : BaseX Objet : Re: [basex-talk] Copy between databases Hi Marco, > what is the best way to copy/move collections of resources from one db > to another? Here is one way to do it: db:open('source', 'a') ! db:add('target', ., db:path(.)) Cheers, Christian
CG
Christian Grün4 Aug 2014 11:31 #
Quoted text · Fabrice Etanchaud · 2 lines
> Is data serialized/deserialized in your example, > Or is it working directly on the internal data format ?
No data will be serialized in this example, but it may happen that, due to the semantics of the pending update, you may encounter OutOfMemory issues when copying very large documents.
Christian
Quoted text · Fabrice Etanchaud · 23 lines
> > Best regards, > Fabrice Etanchaud > Questel/Orbit > > -----Message d'origine----- > De : basex-talk-bounces at mailman.uni-konstanz.de [mailto:basex-talk-bounces at mailman.uni-konstanz.de] De la part de Christian Grün > Envoyé : lundi 4 août 2014 11:06 > À : Marco Lettere > Cc : BaseX > Objet : Re: [basex-talk] Copy between databases > > Hi Marco, > >> what is the best way to copy/move collections of resources from one db >> to another? > > Here is one way to do it: > > db:open('source', 'a') ! db:add('target', ., db:path(.)) > > Cheers, > Christian
Written for BaseX 7.9. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery