Skip to main content
Version: 1.2.x

DEFINE DATABASE

DEFINE DATABASE statement

The DEFINE DATABASE statement allows you to instantiate a named database, enabling you to specify security and configuration options.

Requirements

  • You must be authenticated as a root or namespace user before you can use the DEFINE DATABASE statement.
  • You must select your namespace before you can use the DEFINE DATABASE statement.

Statement syntax

SurrealQL Syntax
DEFINE DATABASE @name

Example usage

Below shows how you can create a database using the DEFINE DATABASE statement.

-- Specify the namespace for the database
USE NS abcum;
-- Define database
DEFINE DATABASE app_vitalsense;