vierge-noire / cakephp-test-suite-light

A fast test suite for CakePHP applications
MIT License
13 stars 7 forks source link

PostgresTriggerBasedTableSniffer Postgres Version #56

Closed toby2g closed 2 years ago

toby2g commented 2 years ago

Not sure if this is the right place to raise it, but the SQL outlined in the PostgresTriggerBasedTableSniffer.php file is targeted towards more recent versions of Postgres.

CALL looks to be introduced in Postgres 11

e.g. $connection->execute('CALL TruncateDirtyTables();');

CREATE OR REPLACE PROCEDURE also looks to be introduced in Postgres 11.

e.g. $this->getConnection()->execute(" CREATE OR REPLACE PROCEDURE TruncateDirtyTables() AS $$

pabloelcolombiano commented 2 years ago

@toby2g thank you for the report. This is indeed the right place to discuss the issue. I see here the following options:

  1. Require users to use Postgres version <= 11 since Postgres 10 end of life is scheduled for November.
  2. Require (from you?) a PR to make Postgres 10 compatible.

What do you think?

toby2g commented 2 years ago

@pabloelcolombiano I think #1 sounds like the best option. Users can create a custom Sniffer if they don't have access to Postgres 11.

Would it would also be possible to update the documentation to outline that the default Postgres Sniffer provided in this library only supports Version 11+. I'm assuming this would be done through a PR?

pabloelcolombiano commented 2 years ago

Sounds good. Yes feel free to add a PR for the docs!

toby2g commented 2 years ago

PR created. #57