Learn R Programming

RBaseX (version 0.2.4)

Create: Create

Description

Creates a new database with the specified name and input (may be empty).

Usage

Create(session, name, input)

Arguments

session

BasexClient instance-ID

name

Database name

input

Additional input, may be empty

Value

A list with two items

  • info Aditional info

  • success A boolean, indicating if the command was completed successfull

Details

Initial content can be offered as string, URL or file. 'Check' is a convenience command that combines OPEN and CREATE DB: If a database with the name input exists, and if there is no existing file or directory with the same name that has a newer timestamp, the database is opened. Otherwise, a new database is created; if the specified input points to an existing resource, it is stored as initial content.

Examples

Run this code
# NOT RUN {
Create(, "test", "<xml>Create test</xml>")
Execute(Session, "Check test")
Create(Session, "test2",
  "https://raw.githubusercontent.com/BaseXdb/basex/master/basex-api/src/test/resources/first.xml")
Create(Session, "test3", "/home/username/Test.xml")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab