• Start

Languages

/

Swift

/

Methods

connect

The connect() method for the SurrealDB Swift SDK connects the client to the configured endpoint.

Connects the client to the endpoint it was configured with.

Method Syntax

try await client.connect()
let client = try SurrealHTTPClient(endpoint: "http://localhost:8000")
try await client.connect()
defer { Task { await client.close() } }

See Connecting to SurrealDB for the available client types and configuration options.

Was this page helpful?