public function debug(bool $oneLine = false): string
    {
        $query = $this->getSQL();

        foreach ($this->getBindings()->getBindings() as $parameter => $bind) {
            if ($parameter[0] == ':') {
                $parameter = substr($parameter, 1);
            }

            $value = $bind->getValue();

            $type = gettype($value);
            switch ($type) {
                case 'string':
                    $query = str_replace(":{$parameter}", ("'" . addslashes((string) $value) . "'"), $query);
                    break;

                case 'integer':
                case 'float':
                case 'double':
                    $query = str_replace(":{$parameter}", $value, $query);
                    break;

                case 'NULL':
                    $query = str_replace(":{$parameter}", 'NULL', $query);
                    break;

                case 'boolean':
                    $true = (bool)$value;
                    $query = str_replace(":{$parameter}", $true ? 'true' : 'false', $query);
                    break;

                case 'object':
                case 'array':
                case 'resource':
                case 'unknown type':
	                throw new QueryException("Unsupported type ({$type}) was passed as parameter ({$parameter}) to SQL statement");
                    break;

                default:
	                throw new \Koldy\Exception('Unknown data type (' . $type . ') was passed to SQL statement');
                    break;
            }
        }

        if ($oneLine) {
            $query = str_replace("\t", '', $query);
            $query = str_replace("\n", ' ', $query);
            $query = str_replace('  ', ' ', $query);
        }

        return $query;
    }