// This renders the restore page similar to backup page app.get(routes.restore, function(req, res) { // get all the crontabs restore.crontabs(req.query.db, function(docs){ res.render('restore', { routes : JSON.stringify(routes_relative), crontabs : JSON.stringify(docs), backups : crontab.get_backup_names(), db: req.query.db }); }); });
constructor(url, parse) { // Construct the url with an un-parsed querystring super(url); if (parse) { // If we want the querystring to be parsed, use this.set('query', query) // as it will always parse the string. If there is no initial querystring // pass an object which will act as the parsed query. this.set('query', this.query || {}); } }
it("where clause unit ?_where=(a,in,1,2,3) should PASS", function(done) { var err = whereClause.getConditionClause("(a,in,1,2,3)"); err.err.should.be.equal(0); err.query.should.be.equal("(?? in (?,?,?))"); done(); });
handleFind(req) { const body = Object.assign(req.body, _ClassesRouter.default.JSONFromQuery(req.query)); const options = _ClassesRouter.default.optionsFromBody(body); return _rest.default.find(req.config, req.auth, '_Audience', body.where, options, req.info.clientSDK, req.info.context).then(response => { response.results.forEach(item => { item.query = JSON.parse(item.query); }); return { response: response }; }); }
defer.then(() => { // Run an update return this.config.database.update(this.className, this.query, this.data, this.runOptions, false, false, this.validSchemaController).then(response => { response.updatedAt = this.updatedAt; this._updateResponseWithData(response, this.data); this.response = { response }; }); })
async bulkRead(req, res) { let queryParamsObj = {}; queryParamsObj.query = ""; queryParamsObj.params = []; this.mysql.prepareListQuery(req, res, queryParamsObj, 3); //console.log(queryParamsObj.query, queryParamsObj.params); let results = await this.mysql.exec( queryParamsObj.query, queryParamsObj.params ); res.status(200).json(results); }
path() { if (this.expression) { return null; } return this.query.cubeEvaluator.parsePath('measures', this.measure); }
decompose() { return this.loadResponses.map((result) => new ResultSet({ queryType: QUERY_TYPE.REGULAR_QUERY, pivotQuery: { ...result.query, queryType: QUERY_TYPE.REGULAR_QUERY, }, results: [result] }, this.options)); }
/** * @api {get} /api/v1/scene get * @apiName get * @apiGroup Scene * */ async function get(req, res) { const scenes = await gladys.scene.get(req.query); res.json(scenes); }
it('can resolve a custom query', async () => { const result = await apolloClient.query({ variables: { message: 'hello' }, query: gql` query CustomQuery($message: String!) { customQuery(message: $message) } `, }); expect(result.data.customQuery).toEqual('hello'); });
router.get('/methods.json', (req, res) => { const {type} = req.query; const {args} = req.query; let method = 'system.listMethods'; if (type === 'help') { method = 'system.methodHelp'; } else if (type === 'signature') { method = 'system.methodSignature'; } client.listMethods(req.user, req.services, method, args, ajaxUtil.getResponseFn(res)); });
/** * @api {get} /api/v1/scene get * @apiName get * @apiGroup Scene * */ async function get(req, res) { const scenes = await gladys.scene.get(req.query); res.json(scenes); }
constructor(url, parse) { // Construct the url with an un-parsed querystring super(url); if (parse) { // If we want the querystring to be parsed, use this.set('query', query) // as it will always parse the string. If there is no initial querystring // pass an object which will act as the parsed query. this.set('query', this.query || {}); } }