SurrealDB Docs Logo

Enter a search query

->use()

Switch to a specific namespace and database. If only the ns or db property is specified, the current connection details will be used to fill the other property.

Method Syntax
$db->use([ "namespace" => "...", "database" => "..." ]);

Arguments

ArgumentsDescription
namespaceINITIALLY REQUIRED

Switches to a specific namespace.

databaseINITIALLY REQUIRED

Switches to a specific database.

Example usage

$db->use([
    "namespace" => "surrealdb",
    "database" => "docs"
]);

On this page

© SurrealDB GitHub Discord Community Cloud Features Releases Install