-1

New to BaseX. Working on a project where 100's or sometimes 1000's of XML files are generated each day. Due to other exogenous factors, the preferred file structure would look like:
 blah/20220714/
 blah/20220715/
 etc…

Is there some way to create this database architecture in BaseX?

In the documentation, a single folder seems to be the only option: “CREATE DB db /path/to/resources will add initial documents to a database”. It seems there is an ‘ADD’ command available to append files to the database; could this theoretically be run each day to append the new folder that gets created?

dcs1001
  • 3
  • 3

1 Answers1

0

You can use CREATE DB to create an empty database or a database with an initial set of documents. If you have a fixed set of resources that you want to import, it’s faster to use this bulk import feature than adding the documents in a second step.

With ADD, you can import additional files, directories, remote source, etc. later on, whenever you like.

Christian Grün
  • 6,012
  • 18
  • 34
  • Hi Christian, thx for the response. Just to clarify, there's no parameter or switch available in the CREATE command that automatically includes subdirectories? Assuming the answer is no, it sounds like I will need to programmatically run the ADD command each day after the new directory is populated. Is this still the preferred way to run commands using Java? : [link](https://github.com/BaseXdb/basex/blob/master/basex-examples/src/main/java/org/basex/examples/local/RunCommands.java) – dcs1001 Jul 25 '22 at 04:33
  • If you supply an initial directory argument to the CREATE command, all its subdirectories will be parsed as well. It’s a one-time operation, though, so your database won’t get updated if you add new files to the file system. It’s a viable option to call ADD every time after new files have been added. – Christian Grün Jul 25 '22 at 08:23
  • Thanks so much for taking the time to point me in the right direction. Danke Shoen!! – dcs1001 Jul 26 '22 at 04:51