Patrick R
12/07/2025, 7:47 AMcriccomini
12/07/2025, 4:57 PMcriccomini
12/07/2025, 5:06 PMcriccomini
12/07/2025, 5:07 PMpath (/tmp/cache) .. fully disregarding the path prefix provided in WithUrl...criccomini
12/07/2025, 5:07 PMobject_store cratecriccomini
12/07/2025, 5:12 PMpackage main
import (
"fmt"
"slatedb.io/slatedb-go"
)
func main() {
db, err := slatedb.Open("/tmp/slatedb-go-test-thing/mydb", slatedb.WithUrl[slatedb.DbConfig]("file:///"))
if err != nil {
panic(err)
}
defer db.Close()
batch, err := slatedb.NewWriteBatch()
if err != nil {
panic(err)
}
defer batch.Close() // Always close to prevent memory leaks
batch.Put([]byte("key1"), []byte("value1"))
batch.Put([]byte("key2"), []byte("value2"))
batch.Delete([]byte("key3"))
err = db.Write(batch)
if err != nil {
panic(err)
}
value, _ := db.Get([]byte("key1"))
fmt.Println(string(value))
err = db.Flush()
if err != nil {
panic(err)
}
}criccomini
12/07/2025, 5:13 PMpath paramcriccomini
12/07/2025, 5:13 PMobject_store crate is supposed to work or there's a bug in how it parses URL roots (at least for LocalFileSystem).
Mind opening a GH issue? I'm pretty sure it's an easy fix once we track it down.criccomini
12/07/2025, 5:14 PMmain and using the Open() strategy I've shown above.criccomini
12/07/2025, 5:15 PMminio, you'll need the allow_http thingy from @Victor Ordazcriccomini
12/07/2025, 5:15 PMcriccomini
12/07/2025, 5:16 PMVictor Ordaz
12/07/2025, 7:16 PMPatrick R
12/07/2025, 10:35 PMcriccomini
12/08/2025, 5:46 PMfile:///some/path part is droppedcriccomini
12/08/2025, 5:59 PM• - WithUrl currently only picks the object-store backend; the path inside that URL is dropped. In slatedb-go/src/object_store.rs:8-31 we call Db::resolve_object_store, and in
slatedb/src/db.rs:1376-1383 the call to DefaultObjectStoreRegistry::resolve returns (store, path) but the path is ignored (let (object_store, _) = …).
- For file:///tmp/slatedb-go-test-thing, the registry builds a LocalFileSystem rooted at / and hands back the leftover path tmp/slatedb-go-test-thing, but since that prefix is
discarded, the DB root stays the path argument you pass to Open. With Open("/tmp/mycache", …), all WAL/SST files go under /tmp/mycache, matching what you see.
- To write under /tmp/slatedb-go-test-thing, make that the first argument (e.g., Open("/tmp/slatedb-go-test-thing", WithUrl("file:///"))) or change resolve_object_store to
apply the URL prefix (e.g., wrap the store in a PrefixStore/LocalFileSystem::new_with_prefix using the returned path).
Going to fix and add a test to verify. We need to use PrefixStore.