The CborgDB Go Driver is 🚧 still under development 🚧 and CborgDB also.
- Download
go get github.com/cborgdb/cborg-go-driver
- Import
import "github.com/cborgdb/cborg-go-driver/cborg"
- Run docker container
docker run -d -p 30000:30000 cborgdb/cborg:0.6.0
- Run the following sample code
package main
import (
"os"
"github.com/cborgdb/cborg-go-driver/cborg"
)
func main() {
client := cborg.NewClient("127.0.0.1", "30000")
err := client.Connect()
if err != nil {
os.Exit(1)
}
defer client.Disconnect()
// Create Database
result, _ := client.CreateDatabase("cborgdb")
// Create Collection using previous result
result.Database.CreateCollection("numbers")
// Init "number" Collection
numbers := client.Database("cborgdb").Collection("numbers")
// Insert an item
numbers.InsertOne(1992)
}
Copyright © 2022 Adil Benhlal
The CborgDB Go Driver is licensed under the Apache License.