Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.x] Avoid using rescue() in standalone illuminate/database component. #49355

Merged
merged 1 commit into from Dec 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Illuminate/Database/Schema/SQLiteBuilder.php
Expand Up @@ -2,6 +2,7 @@

namespace Illuminate\Database\Schema;

use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\File;

class SQLiteBuilder extends Builder
Expand Down Expand Up @@ -37,7 +38,13 @@ public function dropDatabaseIfExists($name)
*/
public function getTables()
{
$withSize = rescue(fn () => $this->connection->scalar($this->grammar->compileDbstatExists()), false, false);
$withSize = false;

try {
$withSize = $this->connection->scalar($this->grammar->compileDbstatExists());
} catch (QueryException $e) {
//
}

return $this->connection->getPostProcessor()->processTables(
$this->connection->selectFromWriteConnection($this->grammar->compileTables($withSize))
Expand Down