• Start

Languages

/

Rust

/

Methods

use_defaults

The .use_defaults() method for the SurrealDB Rust SDK selects the default namespace and database for this connection, if the server and client are configured to provide one.

Clears the explicit USE state for namespace and database and uses the default values associated with the connection. The outcome depends on your endpoint and DEFINE configuration.

Method Syntax

db.use_defaults().await?

This complements use_ns() and use_db() when you want to reset to defaults instead of a specific pair.

Was this page helpful?