Zero-dependency Google Cloud Datastore client for Go. Drop-in replacement for cloud.google.com/go/datastore with an in-memory mock implementation.
Why? The official client has 50+ dependencies. ds9 has zero—ideal for lightweight services and minimizing supply chain risk.
go get github.com/codeGROOVE-dev/ds9This isn't the API we would choose, but our primary goal was a drop-in replacement, so usage is exactly the same as the cloud.google.com/go/datastore library:
import "github.com/codeGROOVE-dev/ds9/pkg/datastore"
client, _ := datastore.NewClient(ctx, "my-project")
key := datastore.NameKey("Task", "task-1", nil)
client.Put(ctx, key, &task)
client.Get(ctx, key, &task)Just switch the import path from cloud.google.com/go/datastore to github.com/codeGROOVE-dev/ds9/pkg/datastore.
Supported Features
- Basically everything that the upstream datastore library has
Unsupported Features
- Nested slices, map types, esoteric advanced query features like streaming aggregations
- Use
datastore.NewMockClient(t)for in-memory testing. Works even if you're still using the official client. - See TESTING.md for integration tests.
- We aim to maintain 85% test coverage - please don't send PRs without tests.
