Skip to content

Commit

Permalink
fix: Fix to RunSQLQueryCommand
Browse files Browse the repository at this point in the history
  • Loading branch information
usernane committed Apr 30, 2024
1 parent fe4e85a commit 87dc2e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions webfiori/framework/cli/commands/RunSQLQueryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,13 @@ private function connectionBased($dbConnections) : int {
$schema = new DB($connName);

if ($file !== null) {
$fileObj = new File($file);
$fileObj = new File(ROOT_PATH.DS.$file);

Check warning on line 124 in webfiori/framework/cli/commands/RunSQLQueryCommand.php

View check run for this annotation

Codecov / codecov/patch

webfiori/framework/cli/commands/RunSQLQueryCommand.php#L124

Added line #L124 was not covered by tests

if ($fileObj->isExist()) {
$fileObj->read();

if ($fileObj->getMIME() == 'application/sql') {
$mime = $fileObj->getMIME();

Check warning on line 128 in webfiori/framework/cli/commands/RunSQLQueryCommand.php

View check run for this annotation

Codecov / codecov/patch

webfiori/framework/cli/commands/RunSQLQueryCommand.php#L128

Added line #L128 was not covered by tests

if ($mime == 'application/sql' || $mime == 'application/x-sql') {

Check warning on line 130 in webfiori/framework/cli/commands/RunSQLQueryCommand.php

View check run for this annotation

Codecov / codecov/patch

webfiori/framework/cli/commands/RunSQLQueryCommand.php#L130

Added line #L130 was not covered by tests
return $this->runFileQuery($schema, $fileObj);
} else {
$this->error('Provided file is not SQL file!');
Expand Down

0 comments on commit 87dc2e3

Please sign in to comment.