Skip to content

Commit 7eb12ab

Browse files
committed
Fixed styleci error
1 parent 9823017 commit 7eb12ab

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/QueryDataTable.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,29 +1047,29 @@ protected function applyFixedOrderingToQuery(string $keyName, array $orderedKeys
10471047
$this->query->orderByRaw("FIELD($keyName, ".$orderedKeys->implode(',').')');
10481048
break;
10491049

1050-
/*
1051-
TODO: test implementations, fix if necessary and uncomment
1052-
case 'pgsql':
1053-
// PostgreSQL
1054-
$this->query->orderByRaw("array_position(ARRAY[" . $orderedKeys->implode(',') . "], $keyName)");
1055-
break;
1056-
1057-
case 'sqlite':
1058-
case 'sqlsrv':
1059-
// SQLite & Microsoft SQL Server
1060-
1061-
// should be generally compatible with all drivers using SQL syntax (but ugly solution)
1062-
$this->query->orderByRaw(
1063-
"CASE $keyName "
1064-
.
1065-
$orderedKeys
1066-
->map(fn($value, $index) => "WHEN $keyName = $value THEN $index")
1067-
->implode(' ')
1068-
.
1069-
" END"
1070-
);
1071-
break;
1072-
*/
1050+
/*
1051+
TODO: test implementations, fix if necessary and uncomment
1052+
case 'pgsql':
1053+
// PostgreSQL
1054+
$this->query->orderByRaw("array_position(ARRAY[" . $orderedKeys->implode(',') . "], $keyName)");
1055+
break;
1056+
1057+
case 'sqlite':
1058+
case 'sqlsrv':
1059+
// SQLite & Microsoft SQL Server
1060+
1061+
// should be generally compatible with all drivers using SQL syntax (but ugly solution)
1062+
$this->query->orderByRaw(
1063+
"CASE $keyName "
1064+
.
1065+
$orderedKeys
1066+
->map(fn($value, $index) => "WHEN $keyName = $value THEN $index")
1067+
->implode(' ')
1068+
.
1069+
" END"
1070+
);
1071+
break;
1072+
*/
10731073

10741074
default:
10751075
throw new \Exception("Unsupported database driver: $driver_name");

0 commit comments

Comments
 (0)