Skip to content

Commit

Permalink
Pluralize ConnectionsCount
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jul 23, 2024
1 parent f3fd158 commit f192c32
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected function getConnectionName(ConnectionInterface $connection, $database)
*/
protected function getConnectionCount(ConnectionInterface $connection)
{
return $connection->getSchemaBuilder()->getConnectionCount();
return $connection->getSchemaBuilder()->getConnectionsCount();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Console/MonitorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function parseDatabases($databases)
}

$maxConnections = $this->option('max');
$connections = $this->connection->connection($database)->getSchemaBuilder()->getConnectionCount();
$connections = $this->connection->connection($database)->getSchemaBuilder()->getConnectionsCount();

return [
'database' => $database,
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Console/ShowCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function handle(ConnectionResolverInterface $connections)
'name' => $connection->getDriverTitle(),
'connection' => $connection->getName(),
'version' => $connection->getServerVersion(),
'open_connections' => $schema->getConnectionCount(),
'open_connections' => $schema->getConnectionsCount(),
],
'tables' => $this->tables($connection, $schema),
];
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ public function setConnection(Connection $connection)
*
* @return int|null
*/
public function getConnectionCount()
public function getConnectionsCount()
{
$query = $this->grammar->compileConnectionCount();
$query = $this->grammar->compileConnectionsCount();

return $query ? $this->connection->scalar($query) : null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/Grammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ public function supportsSchemaTransactions()
*
* @return string|null
*/
public function compileConnectionCount()
public function compileConnectionsCount()
{
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Schema/Grammars/MariaDbGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ protected function typeGeometry(Fluent $column)
);
}

public function compileConnectionCount()
public function compileConnectionsCount()
{
return 'select variable_value as `Value` from information_schema.global_status where variable_name = \'Threads_connected\'';
return 'select variable_value as `Value` from information_schema.global_status where variable_name = \'THREADS_CONNECTED\'';
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1338,7 +1338,7 @@ protected function wrapJsonSelector($value)
return 'json_unquote(json_extract('.$field.$path.'))';
}

public function compileConnectionCount()
public function compileConnectionsCount()
{
return 'select variable_value as `Value` from performance_schema.session_status where variable_name = \'threads_connected\'';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ protected function modifyGeneratedAs(Blueprint $blueprint, Fluent $column)
return $sql;
}

public function compileConnectionCount()
public function compileConnectionsCount()
{
return 'select count(*) as "Value" from pg_stat_activity';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@ public function quoteString($value)
return "N'$value'";
}

public function compileConnectionCount()
public function compileConnectionsCount()
{
return 'select count(*) Value from sys.dm_exec_sessions where status = N\'running\'';
}
Expand Down

0 comments on commit f192c32

Please sign in to comment.