protected function assembleQuery($initial, $recursive)
    {
        $tmp_tbl = 'name_tree';
        $recursive = str_replace(':tmp_tbl', $tmp_tbl, $recursive);

        $final = "select distinct * from $tmp_tbl";

        if (DB::connection()->getDriverName() == 'mysql') {
            return "Call WITH_EMULATOR('$tmp_tbl', '$initial', '$recursive', '$final', 0, 'ENGINE=MEMORY');";
        }

        return "WITH RECURSIVE $tmp_tbl AS ($initial UNION ALL $recursive) $final;";
    }