CartoDB-SQL-API/batch/models/query/query_factory.js

17 lines
351 B
JavaScript
Raw Normal View History

2016-06-01 16:39:01 +08:00
'use strict';
var QueryFallback = require('./query_fallback');
function QueryFactory() {
}
module.exports = QueryFactory;
QueryFactory.create = function (job, index) {
if (QueryFallback.is(job.query.query[index])) {
return new QueryFallback(job, index);
}
throw new Error('there is no query class for the provided query');
};