Database Size Check Throw error when i used PostgreSQL Database #159
Unanswered
Zubairsoft
asked this question in
Q&A
Replies: 2 comments 4 replies
-
We need the size as an I'm not a postgres user myself (this functionality was contributed). I'd appreciate a PR that fixes this, not by changing the typehint, but by making sure the function actual returns an int. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using this package to check my application health and everything is going well. However, when I checked the size of the database using the
DataBaseSizeCheck
class, it threw an error:Spatie\Health\Support\DbConnectionInfo::getPostgresDatabaseSize(): Return value must be of type int, string returned
at vendor/spatie/laravel-health/src/Support/DbConnectionInfo.php:67
63▕ protected function getPostgresDatabaseSize(ConnectionInterface $connection): int
64▕ {
65▕ return $connection->selectOne('SELECT pg_size_pretty(pg_database_size(?)) AS size;', [
66▕ $connection->getDatabaseName(),
➜ 67▕ ])->size;
68▕ }
69▕ }
70▕
I think this issue is related to the return type hint of
getPostgresDatabaseSize()
method it actually returns a string but the return type hint is an integer.Thank you.
Beta Was this translation helpful? Give feedback.
All reactions