-
Notifications
You must be signed in to change notification settings - Fork 639
Basic Operations
roseduan edited this page Jun 18, 2022
·
3 revisions
Basic operations for RoseDB.
package main
import (
"fmt"
"github.com/flower-corp/rosedb"
"path/filepath"
)
func main() {
path := filepath.Join("/tmp", "rosedb")
// specify other options
// opts.XXX
opts := rosedb.DefaultOptions(path)
db, err := rosedb.Open(opts)
if err != nil {
fmt.Printf("open rosedb err: %v", err)
return
}
defer func() {
_ = db.Close()
}()
}
You must specify a file path to open rosedb.
And you can set other options by otps.XXX
.