public function query()
	{
		if ($this->result === null) {
			$this->before_called = true;
			foreach ($this->before_query as $callable) {
				$callable();
			}
			try {
				$this->result = $this->query->query();
				$this->result->setFetchMode(\PDO::FETCH_ASSOC);

			}
			catch (\Smalldb\Flupdo\FlupdoSqlException $ex) {
				error_log("Failed SQL query:\n".$this->query->getSqlQuery());
				error_log("Parameters of failed SQL query:\n".$this->query->getSqlParams());
				throw $ex;
			}
		} else {
			throw new RuntimeException('Query already performed.');
		}
		return $this->result;
	}