diff --git a/src/Db/Adapter/PostgresAdapter.php b/src/Db/Adapter/PostgresAdapter.php index 47f357e5..71495597 100644 --- a/src/Db/Adapter/PostgresAdapter.php +++ b/src/Db/Adapter/PostgresAdapter.php @@ -1614,4 +1614,18 @@ public function bulkinsert(Table $table, array $rows): void $connection->execute($sql, $vals); } } + + /** + * Get the adapter type name + * + * @return string + */ + public function getAdapterType(): string + { + // Hardcoded because the parent implementation + // reads an option that is based off of Database\Driver + // names which is postgres, but pgsql is required for + // compatibility. + return 'pgsql'; + } } diff --git a/tests/TestCase/Db/Adapter/PostgresAdapterTest.php b/tests/TestCase/Db/Adapter/PostgresAdapterTest.php index be354199..a084dbc5 100644 --- a/tests/TestCase/Db/Adapter/PostgresAdapterTest.php +++ b/tests/TestCase/Db/Adapter/PostgresAdapterTest.php @@ -104,6 +104,11 @@ private function usingPostgres10(): bool return version_compare($version, '10.0.0', '>='); } + public function testAdapterType() + { + $this->assertEquals('pgsql', $this->adapter->getAdapterType()); + } + public function testConnection() { $this->assertInstanceOf(Connection::class, $this->adapter->getConnection());