Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datastore: document metadata operations #106

Closed
karalabe opened this issue Jan 23, 2015 · 3 comments
Closed

datastore: document metadata operations #106

karalabe opened this issue Jan 23, 2015 · 3 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@karalabe
Copy link
Contributor

There are quite a lot of metadata operations doable (kind, stat, etc retrieval), which is possible currently too, but only if you know the internal data types and related entity kinds.

E.g.

type KindStat struct {
    KindName            string `datastore:"kind_name"`
    EntityBytes         int    `datastore:"entity_bytes"`
    BuiltinIndexBytes   int    `datastore:"builtin_index_bytes"`
    BuiltinIndexCount   int    `datastore:"builtin_index_count"`
    CompositeIndexBytes int    `datastore:"composite_index_bytes"`
    CompositeIndexCount int    `datastore:"composite_index_count"`

    Count     int       `datastore:"count"`
    Bytes     int       `datastore:"bytes"`
    Timestamp time.Time `datastore:"timestamp"`
}

stats := []KindStat{}
datastore.NewQuery("__Stat_Kind__").GetAll(ctx, &stats)

It would be nice to collect all these metadata types, queries, operations, and have them under a more pleasant API :)

@perry-birch
Copy link

+1 Meta queries would be very helpful in the native libs. (Thanks for the struct def btw, exactly what I needed)

@okdave okdave added the api: datastore Issues related to the Datastore API. label May 29, 2015
@okdave okdave modified the milestone: datastore in beta May 29, 2015
@jba jba added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Jun 23, 2016
@jba jba added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Jun 7, 2017
@jba
Copy link
Contributor

jba commented Aug 22, 2017

I think we can document these in the package somewhere (perhaps by including the above struct). I don't think more client surface is needed.

@jba jba added the help wanted We'd love to have community involvement on this issue. label Aug 22, 2017
@jba jba changed the title datastore: add metadata operations datastore: document metadata operations Dec 11, 2017
@jba
Copy link
Contributor

jba commented Dec 11, 2017

@jba jba closed this as completed Dec 11, 2017
jeanbza pushed a commit to jeanbza/google-cloud-go that referenced this issue Mar 29, 2019
https://golang.org/s/go14customimport

Fixes googleapis#106.

Change-Id: I49516da7293f76f62e3a534b360be284681b7107
Reviewed-on: https://code-review.googlesource.com/3511
Reviewed-by: Brad Fitzpatrick <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. help wanted We'd love to have community involvement on this issue. priority: p2 Moderately-important priority. Fix may not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

4 participants