fix(rust/sled): fix sled errors

This commit is contained in:
hackerchai
2024-07-05 16:55:32 +08:00
parent 2c14dc16dd
commit a36d5b6302
2 changed files with 7 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
package sled
package main
import (
"github.com/goplus/llgo/c"
@@ -6,11 +6,12 @@ import (
)
func main() {
c.Printf(c.Str("helloworld\n"))
//c.Printf(c.Str("helloworld\n"))
var valueLen c.Ulong
conf := &sled.SledConfig{}
conf.SetPath(c.Str("./db.sled"))
db := conf.OpenDB(conf)
db := conf.OpenDB()
db.Set(c.Str("key"), 3, c.Str("value"), 5)
value := db.Get(c.Str("key"), 3)
value := db.Get(c.Str("key"), 3, &valueLen)
c.Printf(c.Str("value: %s\n"), value)
}