public function sql($query, $args = []) {
		if (!is_string($query) || empty($query))
			throw new \InvalidArgumentException("Query is not a valid string");
	
		//open connection
		$this->driver->connect();
			
		//build statement
		$stmt = $this->driver->buildStatement($this->typeManager);
	
		//build query
		$query = $stmt->format($query, $args, $this->config);
		
		//invoke debug callback
		if ($this->hasOption('callback.debug')) {
			$callback = $this->getOption('callback.debug');
			if ($callback instanceof \Closure)
				$callback->__invoke($query);
		}
		
		//run query
		$result = $this->driver->query($query);
	
		//check query execution
		if ($result === false)
			$this->driver->throwQueryException($stmt);
	
		return $result;
	}