Skip to content

Commit

Permalink
feat: use Laravel specific implementation to build raw sql when avail…
Browse files Browse the repository at this point in the history
…able
  • Loading branch information
tpetry committed Jul 13, 2024
1 parent 14348be commit f0b397a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Helpers/DatabaseHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class DatabaseHelper
*/
public function buildRawSql(Connection $db, string $sql, array $bindings = []): string
{
$grammar = $db->getQueryGrammar();
if (method_exists($grammar, 'substituteBindingsIntoRawSql')) {
return $grammar->substituteBindingsIntoRawSql($sql, $bindings);
}

$escapedBindings = [];
foreach ($db->prepareBindings($bindings) as $binding) {
if ($binding === null) {
Expand Down

0 comments on commit f0b397a

Please sign in to comment.