Skip to content

Commit df1d8f1

Browse files
Thomas StrombergThomas Stromberg
authored andcommitted
Reorganize and improve
1 parent b940982 commit df1d8f1

40 files changed

+13472
-11362
lines changed

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ds9
22

3-
Zero-dependency Google Cloud Datastore client for Go. Drop-in replacement for `cloud.google.com/go/datastore` basic operations.
3+
Zero-dependency Google Cloud Datastore client for Go. Drop-in replacement for `cloud.google.com/go/datastore` basic operations. In-memory mock implementation. Comprehensive testing.
44

55
**Why?** The official client has 50+ dependencies. `ds9` uses only Go stdlib—ideal for lightweight services and minimizing supply chain risk.
66

@@ -12,16 +12,24 @@ go get github.com/codeGROOVE-dev/ds9
1212

1313
## Quick Start
1414

15+
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:
16+
1517
```go
16-
import "github.com/codeGROOVE-dev/ds9"
18+
import "github.com/codeGROOVE-dev/ds9/pkg/datastore"
1719

18-
client, _ := ds9.NewClient(ctx, "my-project")
19-
key := ds9.NameKey("Task", "task-1", nil)
20+
client, _ := datastore.NewClient(ctx, "my-project")
21+
key := datastore.NameKey("Task", "task-1", nil)
2022
client.Put(ctx, key, &task)
2123
client.Get(ctx, key, &task)
2224
```
2325

24-
**Supported:**
26+
## Migrating from cloud.google.com/go/datastore
27+
28+
Just switch the import path from `cloud.google.com/go/datastore` to `github.com/codeGROOVE-dev/ds9/pkg/datastore`.
29+
30+
## Features
31+
32+
**Supported Features**
2533
- **CRUD**: Get, Put, Delete, GetMulti, PutMulti, DeleteMulti
2634
- **Transactions**: RunInTransaction, NewTransaction, Commit, Rollback
2735
- **Queries**: Filter, Order, Limit, Offset, Ancestor, Project, Distinct, DistinctOn, Namespace, Run (iterator), Count
@@ -30,18 +38,14 @@ client.Get(ctx, key, &task)
3038
- **Mutations**: NewInsert, NewUpdate, NewUpsert, NewDelete, Mutate
3139
- **Types**: string, int, int64, int32, bool, float64, time.Time, slices ([]string, []int64, []int, []float64, []bool)
3240

33-
## Migrating from Official Client
34-
35-
Change the import—API is compatible:
36-
```go
37-
// import "cloud.google.com/go/datastore"
38-
import "github.com/codeGROOVE-dev/ds9"
39-
```
41+
**Unsupported Features**
4042

41-
Use `ds9mock` package for in-memory testing. See [TESTING.md](TESTING.md) for integration tests.
43+
These features are unsupported just because we haven't found a use for the feature yet. PRs welcome:
4244

43-
## Limitations
45+
* Embedded structs, nested slices, map types, some advanced query features (streaming aggregations, OR filters).
4446

45-
Not supported: embedded structs, nested slices, map types, some advanced query features (streaming aggregations, OR filters).
47+
## Testing
4648

47-
See [example/](example/) for usage. Apache 2.0 licensed.
49+
* Use `github.com/codeGROOVE-dev/ds9/pkg/mock` package for in-memory testing. It should work even if you choose not to use ds9.
50+
* See [TESTING.md](TESTING.md) for integration tests.
51+
* We aim to maintain 85% test coverage - please don't send PRs without tests.

0 commit comments

Comments
 (0)