-
Notifications
You must be signed in to change notification settings - Fork 596
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
spanner: various bug fixes + test coverage #2313
spanner: various bug fixes + test coverage #2313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some initial thoughts before I look at the tests.
packages/spanner/src/codec.js
Outdated
} | ||
|
||
var isSpecialNumber = is.infinite(field) || | ||
(typeof field === 'number' && isNaN(field)); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -577,6 +593,25 @@ Database.prototype.run = function(query, options, callback) { | |||
* .on('end', function() {}); | |||
* | |||
* //- | |||
* // If you need to enforce a specific param type, a types map can be provided. | |||
* // This is typically useful if your param value can be null. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/database.js
Outdated
var type = reqOpts.types[prop] | ||
var child; | ||
|
||
if (is.object(type)) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/database.js
Outdated
|
||
for (var prop in reqOpts.params) { | ||
var field = reqOpts.params[prop]; | ||
|
||
if (!reqOpts.types[prop]) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/table.js
Outdated
@@ -347,10 +349,10 @@ Table.prototype.insert = function(keyVals, callback) { | |||
* be yielded. If using a composite key, provide an array within this array. | |||
* See the example below. | |||
* @param {string=} query.index - The name of an index on the table. | |||
* @param {number} query.limit - The number of rows to return. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
.then(function() { | ||
var promise = Promise.resolve(); | ||
|
||
for (var i = 0; i < 5; i++) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
return database.create() | ||
.then(onPromiseOperationComplete) | ||
.then(function() { | ||
return table.create(multiline.stripIndent(function() {/* |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
var gaxOptions = reqOpts.gaxOptions; | ||
delete reqOpts.gaxOptions; | ||
|
||
config.method(reqOpts, gaxOptions, function(err, resp) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/transaction.js
Outdated
var reqOpts = extend({ | ||
session: this.session.formattedName_ | ||
}, config.reqOpts); | ||
|
||
var gaxOptions = reqOpts.gaxOptions; | ||
delete reqOpts.gaxOptions; | ||
|
||
return config.method(reqOpts, gaxOptions); | ||
// return config.method(reqOpts, gaxOptions); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/transaction.js
Outdated
requestStream.on('error', function(err) { | ||
if (err.code !== ABORTED) { | ||
userStream.emit('error', err); | ||
return; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
packages/spanner/src/database.js
Outdated
* params: { | ||
* name: 'Eddie Wilson' | ||
* sql: 'SELECT * FROM Singers WHERE name = @name AND id = @id', | ||
* params: {, |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Closes #2273
Closes #2197
Closes #2176