new()
Connects to a local or remote database endpoint.
Method SyntaxSurreal::new::<T>(address)
Argument | Description | ||
---|---|---|---|
endpoint | The database endpoint to connect to. |
use surrealdb::engine::remote::ws::Ws; use surrealdb::Surreal; async fn main() -> surrealdb::Result<()> { let db = Surreal::new::<Ws>("127.0.0.1:8000").await?; Ok(()) }