public function getQuery(): string
    {
        $sql = $this->getSql();

        $sql = str_replace(['%', '?'], ['%%', '"%s"'], $sql);

        // replace mask by data
        return vsprintf($sql, $this->getParams());
    }
public function getQuery(): string
    {
        $sql = $this->getSql();

        $sql = str_replace(['%', '?'], ['%%', '"%s"'], $sql);

        // replace mask by data
        return vsprintf($sql, $this->getParams());
    }
public function getQuery ( ) : string { $ sql = $ this -> getSql ( ) ; $ sql = str_replace ( [ '%' , '?' ] , [ '%%' , '"%s"' ] , $ sql ) ; // replace mask by data return vsprintf ( $ sql , $ this -> getParams ( ) ) ; }
Return the complete SQL string formed for use

Example
<code>
$sb = new SelectBuilder();
$sb
->select('u')
->from('User', 'u')
->where('id = ?', 42);
echo $qb->getQuery(); // SELECT u FROM User u WHERE id = "42"
</code>

@return string
Return the complete SQL string formed for use