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: update to v1beta3 #897

Merged

Conversation

stephenplusplus
Copy link
Contributor

Fixes #872
Fixes #1049
Fixes #1181

Docs

http://stephenplusplus.github.io/gcloud-node/#/docs/master/datastore

Blockers

To Dos

  • Update resource links (blocked by v1beta3's release (public docs required to get URLs))
    • Resolution: Removed resource links
  • Remove entry from Troubleshooting (docs: explain how Datastore requires userinfo scope #1172)
  • Convert to gRPC
  • Add support for env vars from cli (Support Datastore default dataset env var #1040):
    • DATASTORE_PROJECT_ID
    • DATASTORE_EMULATOR_HOST (protocol not included)
  • Use Service & ServiceObject
  • Tests
    • Unit
      • Entity
      • Index (Datastore, formerly Dataset)
      • Query
      • Request
      • Transaction
    • System
  • Readme snippet update
  • Depend on a new release of protobuf.js (tracking)

⚠️ Big Breaking Changes

Dataset isn't a thing anymore:

var gcloud = require('gcloud')({/*...*/});

Before

var datastore = gcloud.datastore;
var dataset = datastore.dataset();

dataset.get(dataset.key(['Kind', 1]), function(err, results) {});

After

var datastore = gcloud.datastore();
datastore.get(datastore.key(['Kind', 1]), function(err, results) {});

// Use a different project:
var datastore = gcloud.datastore({ projectId: 'grape-spaceship-123' });

@stephenplusplus stephenplusplus added status: blocked Resolving the issue is dependent on other work. api: datastore Issues related to the Datastore API. don't merge labels Sep 26, 2015
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Sep 26, 2015
@stephenplusplus stephenplusplus force-pushed the spp--datastore-v1beta3 branch 4 times, most recently from ffee9e4 to 95e9fa4 Compare September 28, 2015 14:04
@@ -136,7 +135,7 @@ nodeutil.inherits(Dataset, DatastoreRequest);
* @param {string=} options.apiEndpoint - Custom API endpoint.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor Author

Thanks for the review @pcostell! I'll be making some adjustments throughout the week and will ping if I have any questions.

@pcostell
Copy link
Contributor

pcostell commented Oct 6, 2015

No worries -- one more note, the url has changed. So for example for runQuery it is now:

datastore.googleapis.com/v1beta3/projects/<project-id>:runQuery
Instead of www.googleapis.com/datastore/v1beta2/datasets/<project-id>/RunQuery


var reqOpts = {
method: 'POST',
uri: format('{apiEndpoint}/{path}/{projectId}/{method}', {
uri: format('{apiEndpoint}/v1beta3/projects/{projectId}:{method}', {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus
Copy link
Contributor Author

Is v1beta3 generally available? I've been using the response code of https://cloud.google.com/datastore/docs/apis/v1beta3 to tell me if it's live or not, and it's still a 404.

@pcostell
Copy link
Contributor

pcostell commented Apr 1, 2016

The docs and blog post won't drop until Monday, however the API can be enabled: https://console.cloud.google.com/apis/api/datastore.googleapis.com/overview

@stephenplusplus
Copy link
Contributor Author

For users that already have Datastore enabled and have been running v1beta2, they won't have to re-enable the API, right?

@pcostell
Copy link
Contributor

pcostell commented Apr 1, 2016

Any projects active in the last 7 days will not need to re-enable.

@stephenplusplus
Copy link
Contributor Author

Cool, thanks. And more generally, thanks for all of the help along the way! 👍

@pcostell
Copy link
Contributor

pcostell commented Apr 1, 2016

Thank you for helping us get this out the door!

As a heads up, the cloud SDK will not have a grpc emulator at launch time. So users that want to use gcloud-node will have to use the gcd.sh tool directly, which they can get from here.

@pcostell
Copy link
Contributor

pcostell commented Apr 1, 2016

Release notes for Datastore available if you need to link to them: https://cloud.google.com/datastore/release-notes

* @param {number} value - The double value.
*
* @example
* var aDouble = new Double(7.3);

This comment was marked as spam.

This comment was marked as spam.

@stephenplusplus stephenplusplus removed the status: blocked Resolving the issue is dependent on other work. label Apr 2, 2016
@stephenplusplus
Copy link
Contributor Author

@callmehiphop - all squashed.

This reverts commit f686198.
@callmehiphop callmehiphop merged commit 0ebc3b6 into googleapis:master Apr 4, 2016
@callmehiphop
Copy link
Contributor

🎉

@stephenplusplus
Copy link
Contributor Author

@pcostell any API flakiness going on? We are having inconsistent results querying for data:

Commit:

{
  "mutations": [
    {
      "upsert": {
        "key": {
          "path": [
            {
              "kind": "Person",
              "name": "name"
            }
          ]
        },
        "properties": {
          "f": {
            "stringValue": "Full name"
          }
        }
      }
    }
  ],
  "projectId": "nth-circlet-705",
  "mode": "NON_TRANSACTIONAL"
}

Query:

{
  "readOptions": {},
  "query": {
    "distinctOn": [],
    "kind": [
      {
        "name": "Person"
      }
    ],
    "order": [],
    "projection": [],
    "filter": {
      "compositeFilter": {
        "filters": [
          {
            "propertyFilter": {
              "property": {
                "name": "f"
              },
              "op": "EQUAL",
              "value": {
                "stringValue": "Full name"
              }
            }
          }
        ],
        "op": "AND"
      }
    }
  },
  "projectId": "nth-circlet-705"
}

Sometimes the query returns the entity, other times it doesn't. Is there anything we're doing wrong?

@pcostell
Copy link
Contributor

pcostell commented Apr 4, 2016

@stephenplusplus That looks like standard Eventual Consistency. For any e2e tests that require a get and a query you should be using ancestors.

@stephenplusplus
Copy link
Contributor Author

I'm getting it with that as well:

Commit:

{
  "mutations": [
    {
      "upsert": {
        "key": {
          "path": [
            {
              "kind": "People",
              "name": "US"
            },
            {
              "kind": "Person",
              "name": "name"
            }
          ]
        },
        "properties": {
          "f": {
            "stringValue": "Full name"
          }
        }
      }
    }
  ],
  "projectId": "nth-circlet-705",
  "mode": "NON_TRANSACTIONAL"
}

Query

{
  "readOptions": {},
  "query": {
    "distinctOn": [],
    "kind": [
      {
        "name": "Person"
      }
    ],
    "order": [],
    "projection": [],
    "filter": {
      "compositeFilter": {
        "filters": [
          {
            "propertyFilter": {
              "property": {
                "name": "f"
              },
              "op": "EQUAL",
              "value": {
                "stringValue": "Full name"
              }
            }
          }
        ],
        "op": "AND"
      }
    }
  },
  "projectId": "nth-circlet-705"
}

Maybe I'm not understanding how to save and/or query using ancestors?

@stephenplusplus
Copy link
Contributor Author

Sorry, I got it using hasAncestor. I think I'm good.

@pcostell
Copy link
Contributor

pcostell commented Apr 4, 2016

Cool, let me know if there are any other issues

sofisl pushed a commit that referenced this pull request Nov 11, 2022
- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 408439482

Source-Link: googleapis/googleapis@b9f6184

Source-Link: googleapis/googleapis-gen@eb888bc
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWI4ODhiYzIxNGVmYzdiZjQzYmY0NjM0YjQ3MDI1NDU2NWE2NTlhNSJ9
sofisl pushed a commit that referenced this pull request Jan 17, 2023
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. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants