You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
564 B
JavaScript

"use strict";
const syncpipe = require("syncpipe");
const astToQuery = require("../ast-to-query");
const optimizeAST = require("../ast/optimize");
const optimizers = require("../optimizers/schema");
module.exports = function processSchemaUpdate(update) {
return {
... update,
operations: update.operations.map((operation) => {
// FIXME: This is too simplified. A single operation may result in multiple queries.
return syncpipe(operation, [
(_) => optimizeAST(_, optimizers),
// (_) => astToQuery(_.ast)
(_) => _.ast
]);
})
};
};