.New()
Connects to a remote database endpoint.
Method Syntax
surrealdb.New(url, options...)()
Arguments
| Arguments | Description |
|---|
url required | The URL of the database endpoint to connect to. Examples may include http://hostname:8000 or ws://hostname:8000/rpc . |
options optional | Set SurrealDB clients options such as Timeout etc. |
Example usage
surrealdb.New("ws://localhost:8000");
surrealdb.New("ws://cloud.surrealdb.com");
db, err := surrealdb.New("ws://localhost:8000")
if err != nil {
panic(err)
}