Client
Creating a Client
client, err := som.NewClient(ctx, som.Config{
Address: "ws://localhost:8000",
Username: "root",
Password: "root",
Namespace: "myapp",
Database: "production",
})
if err != nil {
log.Fatal(err)
}Configuration Options
type Config struct {
// Address is the SurrealDB server URL
// Supports: ws://, wss://, http://, https://
Address string
// Username for authentication
Username string
// Password for authentication
Password string
// Namespace to use
Namespace string
// Database within the namespace
Database string
}Version Verification
Accessing Repositories
Connection Management
Closing the Client
Context Usage
Raw Queries
Error Handling
Structured Server Errors
Error
Description
Thread Safety
Last updated