Commit 2c008adb authored by Vincent Bechu's avatar Vincent Bechu

[querystorage] Handle schema capacity

parent f3c1c232
/*jslint nomen: true*/
/*global RSVP*/
/*global RSVP, jIO*/
(function (jIO, RSVP) {
"use strict";
......@@ -8,7 +8,9 @@
*
* @class QueryStorage
* @constructor
*
*/
function QueryStorage(spec) {
this._sub_storage = jIO.createJIO(spec.sub_storage);
this._key_schema = spec.key_schema;
......@@ -47,7 +49,8 @@
var this_storage_capacity_list = ["limit",
"sort",
"select",
"query"];
"query",
"schema"];
if (this_storage_capacity_list.indexOf(name) !== -1) {
return true;
......@@ -57,6 +60,7 @@
}
return false;
};
QueryStorage.prototype.buildQuery = function (options) {
var substorage = this._sub_storage,
context = this,
......@@ -75,11 +79,14 @@
((options.select_list === undefined) ||
(substorage.hasCapacity("select"))) &&
((options.limit === undefined) ||
(substorage.hasCapacity("limit")))) {
(substorage.hasCapacity("limit"))) &&
((options.schema === undefined) ||
(substorage.hasCapacity("schema")))) {
sub_options.query = options.query;
sub_options.sort_on = options.sort_on;
sub_options.select_list = options.select_list;
sub_options.limit = options.limit;
sub_options.schema = options.schema;
}
} catch (error) {
if ((error instanceof jIO.util.jIOError) &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment