Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 2, 2024
1 parent 4271a41 commit 516fc84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
7 changes: 7 additions & 0 deletions src/Dibi/Drivers/PdoResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ public function __construct(\PDOStatement $resultSet, string $driverName)
}


public function __destruct()
{
$this->resultSet?->closeCursor();
}


/**
* Returns the number of rows in a result set.
*/
Expand Down Expand Up @@ -63,6 +69,7 @@ public function seek(int $row): bool
*/
public function free(): void
{
$this->resultSet?->closeCursor();
$this->resultSet = null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Dibi/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public static function loadFromFile(Connection $connection, string $file, ?calla

} elseif (str_ends_with($ts = rtrim($s), $delimiter)) {
$sql .= substr($ts, 0, -strlen($delimiter));
$driver->query($sql);
$driver->query($sql)->free();
$sql = '';
$count++;
if ($onProgress) {
Expand Down
12 changes: 6 additions & 6 deletions tests/databases.github.ini
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ database = dibi_test
port = 1433
system = sqlsrv

;[sqlsrv pdo]
;driver = pdo
;dsn = "sqlsrv:Server=localhost,1433;Database=dibi_test"
;user = SA
;password = "YourStrong!Passw0rd"
;system = sqlsrv
[sqlsrv pdo]
driver = pdo
dsn = "sqlsrv:Server=localhost,1433;Database=dibi_test"
user = SA
password = "YourStrong!Passw0rd"
system = sqlsrv

0 comments on commit 516fc84

Please sign in to comment.