Skip to content

Commit

Permalink
datastore: update to v1beta3
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Sawchuk committed Oct 14, 2015
1 parent 9fd2420 commit f7575e8
Show file tree
Hide file tree
Showing 24 changed files with 3,459 additions and 2,496 deletions.
1 change: 1 addition & 0 deletions .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"allowUrlComments": true
},
"excludeFiles": [
"lib/datastore/proto.js",
"system-test/data/*",
"test/testdata/*"
]
Expand Down
3 changes: 3 additions & 0 deletions .jshintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
lib/datastore/proto.js
system-test/data/*
test/testdata/*
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,35 +131,38 @@ var gcloud = require('gcloud');
// Authenticating on a per-API-basis. You don't need to do this if you auth on a
// global basis (see Authentication section above).

var dataset = gcloud.datastore.dataset({
var datastore = gcloud.datastore({
projectId: 'my-project',
keyFilename: '/path/to/keyfile.json'
});

dataset.get(dataset.key(['Product', 'Computer']), function(err, entity) {
var key = datastore.key(['Product', 'Computer']);

datastore.get(key, function(err, entity) {
console.log(err || entity);
});

// Save data to your dataset.
// Save data to Datastore.
var blogPostData = {
title: 'How to make the perfect homemade pasta',
author: 'Andrew Chilton',
isDraft: true
};

var blogPostKey = dataset.key('BlogPost');
var blogPostKey = datastore.key('BlogPost');

dataset.save({
datastore.save({
key: blogPostKey,
data: blogPostData
}, function(err) {
// `blogPostKey` has been updated with an ID so you can do more operations
// with it, such as an update:
dataset.save({
// with it, such as an update.

blogPostData.data.isDraft = false;

datastore.save({
key: blogPostKey,
data: {
isDraft: false
}
data: blogPostData
}, function(err) {
if (!err) {
// The blog post is now published!
Expand Down
2 changes: 1 addition & 1 deletion docs/site/components/docs/datastore-overview.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h3>Datastore Overview</h3>
<p>
The <code>gcloud.datastore</code> object gives you some convenience methods, as well as exposes a <code>dataset</code> function. This will allow you to create a <code>dataset</code>, which is the object from which you will interact with the Google Cloud Datastore.
The <code>gcloud.datastore</code> object allows you to interact with Google Cloud Datastore.
</p>
<p>
To learn more about Datastore, read the <a href="https://cloud.google.com/datastore/docs/concepts/overview">Google Cloud Datastore Concepts Overview</a>.
Expand Down
30 changes: 27 additions & 3 deletions docs/site/components/docs/docs-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ angular.module('gcloud.docs')
]
},

datastorev1Beta3: {
title: 'Datastore',
_url: '{baseUrl}/datastore',
pages: [
{
title: 'Transaction',
url: '/transaction'
},
{
title: 'Query',
url: '/query'
}
]
},

dns: {
title: 'DNS',
_url: '{baseUrl}/dns',
Expand Down Expand Up @@ -218,8 +233,11 @@ angular.module('gcloud.docs')
// deprecate old datastore api.
'<0.8.0': ['datastore'],

// introduce datastore refactor + pubsub.
'>=0.8.0': ['datastoreWithTransaction', 'pubsub'],
// introduce datastore refactor.
'>=0.8.0 <0.24.0': ['datastoreWithTransaction'],

// introduce pubsub api.
'>=0.8.0': ['pubsub'],

// deprecate old storage api.
'<0.9.0': ['storage'],
Expand All @@ -240,6 +258,12 @@ angular.module('gcloud.docs')
'>=0.20.0': ['compute'],

// introduce resource api.
'>=0.22.0': ['resource']
'>=0.22.0': ['resource'],

// deprecate datastore v1beta2 api.
'<0.24.0': ['datastoreWithTransaction'],

// introduce datastore v1beta3 api.
'>=0.24.0': ['datastorev1Beta3']
}
});
272 changes: 0 additions & 272 deletions lib/datastore/dataset.js

This file was deleted.

Loading

0 comments on commit f7575e8

Please sign in to comment.