Skip to content

Commit

Permalink
adding update / put commands to google-bigquery project
Browse files Browse the repository at this point in the history
  • Loading branch information
Bryan Short committed Oct 16, 2013
1 parent 8c7ec59 commit b791118
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion lib/Tables.js
Expand Up @@ -2,7 +2,8 @@ var Tables = function ( options ) {

var post = require('./post')(options),
del = require('./del')(options),
get = require('./get')(options);
get = require('./get')(options),
put = require('./put')(options);

return {
create: function ( table, cb ) {
Expand All @@ -22,6 +23,10 @@ var Tables = function ( options ) {
getAll: function ( datasetId, projId, cb ) {
var url = '/projects/' + projId + '/datasets/' + datasetId + '/tables';
get(url, cb);
},
patch: function ( id, datasetId, projId, patchObj, cb) {
var url = '/projects/' + projId + '/datasets/' + datasetId + '/tables/' + id;
put(url, patchObj, cb);
}
};
};
Expand Down
2 changes: 1 addition & 1 deletion lib/post.js
Expand Up @@ -19,7 +19,7 @@ var post = function ( options ) {
}, function ( err, res, body ) {
if ( err || res.statusCode !== 200 ) {
//console.log(err || res);
cb('there was a problem executing your query');
cb(err);
} else {
cb(undefined,body);
}
Expand Down

0 comments on commit b791118

Please sign in to comment.