Skip to content

Commit

Permalink
Merge pull request #748 from cakephp/fix-747
Browse files Browse the repository at this point in the history
Fix compatibility break from phinx
  • Loading branch information
markstory authored Sep 16, 2024
2 parents 8bc6285 + 5dd0a07 commit d39616f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Db/Adapter/PostgresAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}
}
5 changes: 5 additions & 0 deletions tests/TestCase/Db/Adapter/PostgresAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit d39616f

Please sign in to comment.