SurrealDB Docs Logo

Enter a search query

Surreal / AsyncSurreal

Establishes a persistent connection to the database.

Method Syntax
Surreal(url) AsyncSurreal(url)

Arguments

ArgumentsDescription
url required

The url of the database endpoint to connect to.

Example usage

Surreal('https://cloud.surrealdb.com') # async AsyncSurreal('https://cloud.surrealdb.com')

You can close the connection using the close() method.