Skip to content

Commit 2c858c7

Browse files
committed
Helpers::dumpSql: Fixed bool format for PgSql
1 parent 23617a8 commit 2c858c7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/Database/Helpers.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,10 @@ public static function dumpSql(SqlLiteral $query, ?Explorer $explorer = null): s
142142
return '<i' . (isset($info['uri']) ? ' title="' . htmlspecialchars($info['uri'], ENT_NOQUOTES, 'UTF-8') . '"' : null)
143143
. '>&lt;' . htmlspecialchars($type, ENT_NOQUOTES, 'UTF-8') . ' resource&gt;</i> ';
144144

145-
} elseif (is_bool($param)) {
145+
} elseif (is_bool($param)) {
146+
if($connection->getDriver() instanceof Nette\Database\Drivers\PgSqlDriver) {
147+
return $param ? 'true' : 'false';
148+
}
146149
return (string) (int) $param;
147150

148151
} else {

src/Database/Table/ActiveRow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function getSignature(bool $throw = true): string
106106
* Returns referenced row.
107107
* @return self|null if the row does not exist
108108
*/
109-
public function ref(string $key, ?string $throughColumn = null): ?self
109+
public function ref(string $key, ?string $throughColumn = null)
110110
{
111111
$row = $this->table->getReferencedTable($this, $key, $throughColumn);
112112
if ($row === false) {

0 commit comments

Comments
 (0)