->connect()
Connects to a local or remote database endpoint.
Arguments
| Arguments | Type | Description |
|---|---|---|
host
|
string
| The url of the database endpoint to connect to. |
options
|
associative array
| An object with options to initiate the connection to SurrealDB. |
Example usage
There are several ways to connect to a database endpoint. You can connect to a local or remote endpoint, specify a namespace and database pair to use, authenticate with an existing token, authenticate using a pair of credentials, or use advanced custom logic to prepare the connection to the database.