Skip to content

Commit e201bbf

Browse files
authored
Explicitly add column name to SQLite query (laravel#43832)
Fix for ErrorException: Undefined array key "size" while running artisan db:show on a SQLite database
1 parent 455d160 commit e201bbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Illuminate/Database/Console/DatabaseInspectionCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ protected function getPostgresTableSize(ConnectionInterface $connection, string
149149
*/
150150
protected function getSqliteTableSize(ConnectionInterface $connection, string $table)
151151
{
152-
$result = $connection->selectOne('SELECT SUM(pgsize) FROM dbstat WHERE name=?', [
152+
$result = $connection->selectOne('SELECT SUM(pgsize) AS size FROM dbstat WHERE name=?', [
153153
$table,
154154
]);
155155

0 commit comments

Comments
 (0)