Skip to content

Commit 9376533

Browse files
Merge pull request #1 from jcarouth/support-postgres
Support postgres in db extractor
2 parents c3a7f8e + 567bc98 commit 9376533

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Laravel/DbExtractor.php

+8
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ protected function createHashedQuery()
9797
. '), 2)) as [_hash]'
9898
)
9999
);
100+
} elseif ($this->connection instanceof PostgresConnection) {
101+
$query->addSelect(
102+
$this->connection->raw(
103+
"MD5(CONCAT_WS('|', "
104+
. collect($this->getUniqueColumns())->implode(',')
105+
. ')) AS "_hash"'
106+
)
107+
);
100108
} else {
101109
throw new \RuntimeException('Currently only MySQL and SqlServer are supported inside the ' . __CLASS__);
102110
}

0 commit comments

Comments
 (0)