Using an embedded instance
Setup
Build surrealdb.c and set up CGO
Run the command
go get github.com/surrealdb/surrealdb.c.goWrite code to connect to an embedded instance of SurrealDB.
Note
The following code shows a simple example that opens up an embedded instance in memory, defines a table and then creates and selects a person record that matches the Person struct that the output deserializes into.
More information
For more information on the Go bindings used for an embedded SurrealDB instance, see this page for the surrealdb.c.go repo.
Pages of particular note are:
Storage backends: how to use other endpoints like
rocksdb://.