Skip to main content
Version: Nightly

USE

USE statement

The USE statement specifies a namespace and / or a database to use for the subsequent SurrealQL statements.

Statement syntax

SurrealQL Syntax
USE [ NS @ns ] [ DB @db ];

Example usage

The following query shows example usage of this statement.

USE NS test; -- Switch to the 'test' Namespace
USE DB test; -- Switch to the 'test' Database
USE NS test DB test; -- Switch to the 'test' Namespace and 'test' Database