@function execute

execute query

@returns {Promise}
2020
function execute () {
    // check access and set access params
    this.accessControl()
    // build select
    this.select = sql.select(this.model, this.args)
    // debug
    debug(this.select.sql, this.select.params)
    // do query
    defined(this.model.cache)
        && this.args.cache !== false
        && (!this.modelViewEngine || this.modelViewEngine.cache !== false)
        ? this.executeQueryCached()
        : this.executeQueryDirect()
    // add queries for related records if any
    this.executeRelated()
    // build result
    return this.result()
}
697472
function runQuery(query, connection) {
  const params = {
    host: connection.host,
    port: connection.port ? connection.port : 5433,
    user: connection.username,
    password: connection.password,
    database: connection.database
  };

  return new Promise((resolve, reject) => {
    const client = vertica.connect(params, function(err) {
      if (err) {
        client.disconnect();
        return reject(err);
      }

      let incomplete = false;
      const rows = [];
      let finished = false;
      let columnNames = [];

      const verticaQuery = client.query(query);

      verticaQuery.on('fields', fields => {
        columnNames = fields.map(field => field.name);
      });

      verticaQuery.on('row', function(row) {
        if (rows.length < connection.maxRows) {
          const resultRow = {};
          row.forEach((value, index) => {
            resultRow[columnNames[index]] = value;
          });
          return rows.push(resultRow);
        }
        if (!finished) {
          finished = true;
          client.disconnect();
          incomplete = true;
          return resolve({ rows, incomplete });
        }
      });

      verticaQuery.on('end', function() {
        if (!finished) {
          finished = true;
          client.disconnect();
          return resolve({ rows, incomplete });
        }
      });

      verticaQuery.on('error', function(err) {
        if (!finished) {
          finished = true;
          client.disconnect();
          return reject(err);
        }
      });
    });
  });
}
268696
protected void execute(Connection tx, String query, ExecuteFunction function) {
        try (Query q = new Query(objectMapper, tx, query)) {
            function.apply(q);
        } catch (SQLException ex) {
            throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, ex);
        }
    }
262969
function ExecutionCache() {
  var cache = {};

  function getKey(query) {
    return query.queryKey + '(' + JSON.stringify(query.queryParams) + ')'
  }

  function get(query) {
    return cache[getKey(query)]
  }

  this.execute = function (query) {
    var query = _.cloneDeep(query);
    var execution = get(query);
    if (execution) {
      var requestedKeys = _.keys(query.shape);
      if (_.intersection(_.keys(execution.shape), requestedKeys).length != requestedKeys.length) {
        // TODO we probably should also merge the nested shape
        var newShape = _.assign(execution.shape, query.shape);
        query.shape = newShape;
        execution = {
          shape: newShape,
          promise: getHandler(query.name, query.queryKey)(query.shape, query.queryParams, query.type)
        }
      }
    } else {
      execution = {
        shape: query.shape,
        promise: getHandler(query.name, query.queryKey)(query.shape, query.queryParams, query.type)
      };
    }
    cache[getKey(query)] = execution;
    return execution;
  };

  this.get = get;
  this.getKey = getKey;
  return this;
}
489149
function runQuery(connection, query, options, done) {
  options = _.isObject(options) ? options :
    connection.QueryTypes[options] ? { type: connection.QueryTypes[options] } : {};

  connection.query(query, options)
    .then(function(results) {
      done(null, results);
    })
    .catch(function(error) {
      if (error) {
        output.error("Query error.  SQL has been written to .tables.debug.  Use a smaller batchSize to more easily find the issue.");
        output.error(error);
        fs.writeFileSync(".tables.debug", query);
      }

      done(error);
    });
}
965821
function()
    {
        if (this._executePromise)
            return this._executePromise;

        var q = this.clone();

        var table  = q._T.__name__;
        var page   = q._page;
        var fields = q._fields;

        // Create the query from our stuff
        var query = {};
        _(q._where.concat(q._like)).each(function (q) {
            query[q.key] = q.value;
        });

        var doneLoading      = Q.defer();
        this._executePromise = doneLoading.promise;

        var left = q._take;

        // A single iteration of fetching via the API. Called repeatedly in
        // the case of large / unbounded TAKES
        var loop = function() {

            // always take 1000 unless we're almost done
            var take = left < 1000 ? left : 1000;

            // Hit the API and incremement the page
            q._fetch(table, take, page++, query, fields).then(function(res) {

                // publish progress
                doneLoading.notify(q._results.length);

                if (left !== undefined) left -= res.length;

                // Either resolve the the promise with the results if we're
                // done or call the loop again

                if (q._doneLoading || left <= 0)
                    doneLoading.resolve(q._getResults());
                else
                    process.nextTick(loop);

            }).catch(function(err) {
                doneLoading.reject(err);
            });
        };

        // do tha damn thing
        loop();
        return doneLoading.promise;
    }
503712
async function executePlugin([plugin, options]: PluginCall): Promise<string> {
  return (await resolvePlugin(plugin))(await executeNested(options));
}
219757
function execute(req, res) {
  res.send(null, this.info.toString(req.args[0] ? '' + req.args[0] : null));
}
64281
def execute_sql(self, query):
        
        c = self.con.cursor()
        c.execute(query)
        result = c.fetchall()
        return result
1254273
function execute($request,$silencieux=false){
		if ($silencieux==false) {
			$res = mysql_query($request)
			or
			die($request.' -- '.mysql_error().' -- <br/> Request in file : <b>'.debug_backtrace()[0]['file'].'</b><br/> on line <b>'.debug_backtrace()[0]['line']).'</b>';
		}
		else {
			$res = mysql_query($request);
		}
		return $res;
	}
85985
function query() {
        if(empty($this->sql)) {
            $this->_constructSql();
        }
        list($sql, $param) = $this->_constructSql();
        $this->_reset();
        return $this->execute($sql, $param);
    }
397089
function exec() {
    var defer = q.defer();
    cp.exec(this, function(err, stdout, stderr) {
        if (err) console.log('exec err: '+ err);
        console.log(stdout);
        defer.resolve(err)
    })
    return defer.promise;
}
487908
function(query, data, successCallback, failureCallback) {
			if(typeof successCallback != "function") successCallback = function(){};
			if(typeof failureCallback != "function") failureCallback = function(){ return _throw(new jSQL_Error("0054")); };

			var i, l, remaining;

			if(!Array.isArray(data[0])) data = [data];
			remaining = data.length;
			var innerSuccessCallback = function(tx, rs) {
				var i, l, output = [];
				remaining = remaining - 1;
				if (!remaining) {
					for (i = 0, l = rs.rows.length; i < l; i = i + 1){
						var j = rs.rows.item(i).json;
						//j = JSON.parse(j);
						output.push(j);
					}
					successCallback(output);
				}
			};
			self.db.transaction(function (tx) {
				for (i = 0, l = data.length; i < l; i = i + 1) {
					tx.executeSql(query, data[i], innerSuccessCallback, failureCallback);
				}
			});
		}
5131
private ResultSet executeCQL(String cql) {
        m_logger.debug("Executing CQL: {}", cql);
        try {
            return m_dbservice.getSession().execute(cql);
        } catch (Exception e) {
            m_logger.error("CQL query failed", e);
            m_logger.info("   Query={}", cql);
            throw e;
        }
    }
138216
function ExecuteQuery($query)
    {
        $this->lastQuery = $query;
        $result = mysqli_query($this->db, $query);
        $this->AssertSuccess();

        if ($result instanceof \mysqli_result)
            return new Reader($result);

        return null;
    }
557485
def execute(self, query, params=None, cursor=None):
        
        conn = yield self._get_conn()
        try:
            cur = conn.cursor(cursor)
            yield cur.execute(query, params)
            yield cur.close()
        except:
            self._close_conn(conn)
            raise
        else:
            self._put_conn(conn)
        raise Return(cur)
108605
public function execute()
    {
        $db = $this->db;

        $qp = array();

        if (isset($this->q['query'])) {
            $sth = $db->prepare($this->q['query']);
        } else {
            $qp = $this->makeQuery();
            $sth = $db->prepare($qp['query']);
            foreach ($qp['params'] as $key => $val) {
                if (is_int($val)) {
                    $sth->bindValue("$key", $val, $db::PARAM_INT);
                } else {
                    $sth->bindValue("$key", $val);
                }
            }
        }

        $sth->execute();

        return $sth;
    }