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

Added a check for an extra column and tests #18

Merged
merged 1 commit into from
Sep 22, 2015

Conversation

Pchelolo
Copy link
Contributor

When we try to insert a field that's not in the schema, cassandra silently ignores that and SQLite is throwing a non-descriptive error. However, extra fields clearly indicate a bug in the client - either on table schema, or on a query, so we need to fail-fast and throw an error.

After this is merged, SQLite module would be updated to require the news version of spec and anew version of sqlite will be released.

@@ -330,6 +330,13 @@ validator.validatePutRequest = function(req, schema) {
throw new Error('Invalid query. No schema for ' + req.table);
}

var missingColumn = Object.keys(req.attributes).find(function(attrName) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we separate this into its own method (and then call it from this one), so that we can reuse it in the Cassandra module and reduce code duplication?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be dealt with differently in the Cassandra module, so retracting my question.

d00rman pushed a commit that referenced this pull request Sep 22, 2015
Added a check for an extra column and tests
@d00rman d00rman merged commit ed7521a into wikimedia:master Sep 22, 2015
@d00rman
Copy link
Contributor

d00rman commented Sep 22, 2015

Damn, v0.0.7 already exists. Will create a new PR for bumping the version

@d00rman
Copy link
Contributor

d00rman commented Sep 22, 2015

Ah, v0.0.7 already exists as of #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants