Skip to content

Commit

Permalink
Merge pull request #92 from kalider/bugfix
Browse files Browse the repository at this point in the history
Bug fix
  • Loading branch information
n1crack authored Apr 6, 2023
2 parents f5b5c32 + 55aade8 commit a057134
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/DB/Codeigniter4Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Ozdemir\Datatables\DB;

use Ozdemir\Datatables\Iterators\ColumnCollection;
use Ozdemir\Datatables\Query;

/**
Expand Down Expand Up @@ -67,6 +68,20 @@ public function escape($string, Query $query)
return '?';
}

/**
* @param string $query
* @param ColumnCollection $columns
* @return string
*/
public function makeQueryString(string $query, ColumnCollection $columns): string
{
if ($this->db->getPlatform() == 'Postgre') {
return 'SELECT "'.implode('", "', $columns->names())."\" FROM ($query)t";
}

return 'SELECT `'.implode('`, `', $columns->names())."` FROM ($query)t";
}

/**
* @param $query
* @return string
Expand Down

0 comments on commit a057134

Please sign in to comment.