Skip to content

codeGROOVE-dev/ds9

Repository files navigation

ds9

ds9 logo

Go Reference Go Report Card License: Apache 2.0 Go Version

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.

Installation

go get github.com/codeGROOVE-dev/ds9

Quick Start

This 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)

Migrating from cloud.google.com/go/datastore

Just switch the import path from cloud.google.com/go/datastore to github.com/codeGROOVE-dev/ds9/pkg/datastore.

Features

Supported Features

  • Basically everything that the upstream datastore library has

Unsupported Features

  • Nested slices, map types, esoteric advanced query features like streaming aggregations

Testing

  • 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.

About

#Google #DataStore #Go library with zero dependencies

Resources

License

Stars

Watchers

Forks

Packages

No packages published