Skip to content

Commit 9439cd8

Browse files
authored
Merge pull request #4 from tstromberg/main
Improve compatibility with advanced DataStore features
2 parents 050fa28 + 9765bc5 commit 9439cd8

File tree

9 files changed

+3448
-95
lines changed

9 files changed

+3448
-95
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ client.Put(ctx, key, &task)
2121
client.Get(ctx, key, &task)
2222
```
2323

24-
**Supported:** Get, Put, Delete, GetMulti, PutMulti, DeleteMulti, RunInTransaction, AllKeys, NameKey, IDKey, parent keys.
24+
**Supported:**
25+
- **CRUD**: Get, Put, Delete, GetMulti, PutMulti, DeleteMulti
26+
- **Transactions**: RunInTransaction, NewTransaction, Commit, Rollback
27+
- **Queries**: Filter, Order, Limit, Offset, Ancestor, Project, Distinct, DistinctOn, Namespace, Run (iterator), Count
28+
- **Cursors**: Start, End, DecodeCursor
29+
- **Keys**: NameKey, IDKey, IncompleteKey, AllocateIDs, parent keys
30+
- **Mutations**: NewInsert, NewUpdate, NewUpsert, NewDelete, Mutate
31+
- **Types**: string, int, int64, int32, bool, float64, time.Time, slices ([]string, []int64, []int, []float64, []bool)
2532

2633
## Migrating from Official Client
2734

@@ -35,6 +42,6 @@ Use `ds9mock` package for in-memory testing. See [TESTING.md](TESTING.md) for in
3542

3643
## Limitations
3744

38-
Not supported: property filters, ordering, cursors, ancestor queries, slices/arrays, embedded structs, key allocation.
45+
Not supported: embedded structs, nested slices, map types, some advanced query features (streaming aggregations, OR filters).
3946

4047
See [example/](example/) for usage. Apache 2.0 licensed.

auth/auth_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ func TestSetMetadataURL(t *testing.T) {
4141

4242
func TestAccessTokenFromMetadata(t *testing.T) {
4343
tests := []struct {
44-
name string
45-
statusCode int
4644
response any
47-
wantErr bool
45+
name string
4846
wantToken string
4947
errContains string
5048
metadataFlavor string
49+
statusCode int
50+
wantErr bool
5151
}{
5252
{
5353
name: "success",
@@ -214,12 +214,12 @@ func TestAccessTokenFromADC(t *testing.T) {
214214
defer tokenServer.Close()
215215

216216
tests := []struct {
217+
setupEnv func()
217218
name string
218219
credsData string
219-
setupEnv func()
220-
wantErr bool
221220
errContains string
222221
wantToken string
222+
wantErr bool
223223
}{
224224
{
225225
name: "success with valid credentials",
@@ -310,11 +310,11 @@ func TestAccessTokenFromADC(t *testing.T) {
310310
func TestProjectID(t *testing.T) {
311311
tests := []struct {
312312
name string
313-
statusCode int
314313
response string
315-
wantErr bool
316314
wantProject string
317315
errContains string
316+
statusCode int
317+
wantErr bool
318318
}{
319319
{
320320
name: "success",
@@ -414,10 +414,10 @@ func TestProjectIDMetadataServerDown(t *testing.T) {
414414
func TestExchangeRefreshTokenErrors(t *testing.T) {
415415
tests := []struct {
416416
name string
417-
statusCode int
418417
response string
419-
wantErr bool
420418
errContains string
419+
statusCode int
420+
wantErr bool
421421
}{
422422
{
423423
name: "unauthorized",

0 commit comments

Comments
 (0)