pomm 1.2 is available

Posted 5 years ago.

Better, simpler, faster

The 1.2 branch was under development since April 2013 and it has been an interesting time. The heart of Pomm has been deeply remodelled to bring tremendous features and performances.

  • Pomm uses PHP's native Postgresql API instead of PDO
  • Configurable connections
  • JSON, timestamp with timezone and composite types converter have been added
  • Observer for LISTEN / NOTIFY support
  • Prepared statement pooling
  • Generic logger support (Monolog)

Even though this sounds like a complete reshape, Pomm 1.2 is usable the same way as 1.1 but with added functionalities.

The switch from PDO to native API showed great performances gain in addition to a better support of Postgresql features. Binary type is fully functional and asynchronous message system is supported. This also could lead to a simpler and better collection system. Prepared statements implementation has also been reworked. Every statement is prepared and pooled in a connection. If a statement is issued twice, the prepared statement is re-used without the developer to care about it.

Converters have also been one of the centers of attention. Connections in Pomm 1.2 now configure database output to make the converter's code faster and more robust. Composite type converter is a big achievement making developers able to create complex types in the database and fetch them as PHP objects easily.

There are tons of other little improvements crafted with this release (raw strings, multiple inserts, improved escaping etc.), they are in the whatsnew in the documentation attached with the project. In the same time, code quality has been greatly improved using both scrutinizer and SensioLabs' insight analyzing tool.

Migrating from 1.1

The PDO refactoring led to change the values placeholder in SQL queries, this means all custom SQL queries and Where clauses shall be modified to use $* instead of PDO's ?. Migrating may just be it unless you use the filter chain or the remote fields formatters. Both have been removed with no replacement in 1.2. Since the logger has been changed to support generic PSR logger, there might be some adjustments in your development code to instantiate the logger.

If your application benefits from Postgresql's JSON type, be aware the new JSON converters dumps a PHP associative array instead of a string with Pomm 1.1. Range type signature has also changed so if you used super class of these types, you should change the signature accordingly. the blue box...