Syntax

r.dbCreate(name) → result

Arguments

List of arguments to provide.
name
string
required
Name of the database to create. See notes for restrictions.

Optargs

No optional arguments.

Returns

result
object
Information about the operation.

Behavior

  • When the database is created, it is immediately available for use.
  • When a new RuloDB instance is started with a fresh data directory, a new database, called default, is created automatically.

Notes & Caveats

  • The database name must be less than 255 characters.
  • The database name must consist of ASCII alphanumeric characters, hyphens, and underscores.
  • The database name must be unique within the RuloDB instance.
  • The database name must not be a reserved database name. The following names are reserved: __system__.

Example

Creating a Database

Create a new database called test.
const result = await r.dbCreate('test').run(client);

console.log(`Created ${result.created} database(s)`);
  • r - Referencing the query builder
  • db - Referencing a database
  • dbDrop - Dropping a database
  • dbList - Listing databases

Found a typo? Or maybe a broken link? RuloDB is open-source, help us fix it!