We make elephants to talk
Pomm is a lightweight, fast, efficient and powerful PHP Object Model Manager for the Postgresql relational database. Pomm is not an ORM, it is more like an object oriented database framework implementing the identity map design pattern and proposing a type converter in addition to other convenient features.
Pomm is a framework that aims at making the developers able to leverage Postgresql features. Although there are lot of similarities between Pomm and an ORM, the underlying philosophy is utterly different. With Pomm, developers keep control of the queries hence keep control of the performances while using Postgresql outstanding types and operators with its powerful SQL. Even though lot of programmers think that writing SQL is obsoleted by the use of an ORM, it makes, in one query, the developers able to fetch the data structured like expected with no need to process any further in PHP. This makes the code faster and simpler hence maintainable.
As soon as the database is designed, Pomm's tools can generate PHP model classes by inspecting tables and views. It checks the schema where database objects are stored so generated classes use different PHP namespaces, there will not be naming collision anymore !
Queries return Collections which are iterators on results. Objects are hydrated on demand for minimal memory consumption and data are converted from/to Postgresql. Boolean in Pg are boolean in PHP, arrays in Pg are arrays in PHP, geometric types are converted into geometric PHP objects. Of course this is extendible and custom database types can be converted into custom PHP classes. Almost all standard and geometric types are supported plus HStore and ltree extensions.
Pomm proposes a
Where class to easily chain
OR conditions clauses, passing the values as argument each time for escaping. There is also a
WhereIn method with an array of values as parameter.
Of course 80% of the queries of a web applications are like «SELECT ... FROM ... WHERE ... ». So there is a method for that. You can configure what you do want in the select fields in case you would like to add your classes extra properties. For the more complicated queries, SQL is the way to go. You can use all the awesome operators, full text search, window functions, recursive queries, (insert your preferred feature here).
Pomm provides developers with tools to build their own SQL custom queries.
SELECT :employee_fields_emp, dept.name AS department_name FROM :employee_table emp NATURAL JOIN :department_table dept WHERE emp.employee_id = $*
The example shows how a query looks like and why it make developers life easier in making them not to deal with list of fields but focus on what the query really does. This is a strong point because developers are also able to design queries and databases index to maximise performances.
My name is Grégoire HUBERT, I use Linux, PHP and Postgresql since the 20th century and I started working on a database object model manager in 2010 -- which was named PgLook at the time, you can still use it for your symfony 1.x projects although it is not maintained anymore. Pomm has evolved based on my projects and professional needs. It is released under the MIT/X11 licence so feel free to use, distribute or modify it. You can send me an email at hubert dot greg at gmail dot com or follow me on twitter @chanmix51. You can also follow Pomm's activity on twitter.