Brief introduction about POMM and what's the difference from the ORMs. POMM uses the full strength of PostgreSQL giving object oriented interface on top of it.
years PostgreSQL, DBase3, Interbase, MySQL, MongoDB, Firebird Using ORMs for 8+ years Propel (ActiveRecord based), Doctrine (Hybernate based) Developing with PHP for 13+ years Plain, Symfony1, Symfony2, other frameworks 2 . 2
can be transactional too Triggers are working (Unlike in MySQL triggers can't update the table which they are assigned to.) CREATE TABLE xxx (id int not null); INSERT INTO xxx VALUES ('4555test'); -- ERROR: invalid input syntax for integer: "4555 test" BEGIN; DROP TABLE xxx; ROLLBACK; 3 . 4
tool) in computer science is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. 4 . 1
lot of strings to be parsed $db = new PDO($dsn); $db = mysql_query(); $order = $db->query(' SELECT * FROM orders WHERE id=1', PDO::FETCH_ASSOC); $date = new DateTime($order['date']); $stmt = $db->prepare(' UPDATE orders SET payment_type = ":paymentType" WHERE id = :id'); $stmt->execute([ ':paymentType' => Payment::PAYMENT_TYPE_CASH, ':id' => 1 ]); 4 . 4
people start a new project with the idea to switch later to another database? Why I can't use feature X of the DB? What else does the DB provide but I have to implement at the app level? 5 . 2
when you need only bunch of them? With ORM you always do Yes, I know Doctrine has partial objects support CREATE TABLE very_large_table_with_lots_of_columns ( pk bigserial primary key, name text, ... 50+ columns ... -- Don't tell me you don't have such tables :) ); CREATE INDEX idx_vltwloc_for_selects ON very_large_table_with_lots_of_columns (pk, name); SELECT * FROM very_large_table_with_lots_of_columns WHERE something 6 . 7
{ return parent::createProjection() ->setField( 'is_public', "not '192.168.0.0/16'::inet >> all(%:interfaces:%)", 'bool' ); } //… SELECT c."computer_id" AS "computer_id", …, c."interfaces" AS "interfaces", NOT '192.168.0.0/12'::inet >> ALL(c."interfaces") AS "is_public" FROM public.computer c WHERE … 7 . 3
d.* FROM department d WHERE d.department_id = 9 UNION ALL SELECT d.* FROM department d JOIN sub_department sd ON d.department_id = sd.department_parent_id ) SELECT sd.* FROM sub_department sd; 7 . 5
production, rank() over (partition by country order by production desc) from factory order by country, rank asc ; ┌───────┬──────────┬────────────┬──────┐ │ name │ country │ production │ rank │ ├───────┼──────────┼────────────┼──────┤ │ edno │ bulgaria │ 1512 │ 1 │ │ un │ france │ 2063 │ 1 │ │ deux │ france │ 1821 │ 2 │ │ eins │ germany │ 2211 │ 1 │ .... 7 . 7
of the most used frameworks: Symfony2: Silex: ZF2: You use other framework? Integrate it there too! https:/ /github.com/pomm- project/pomm-bundle https:/ /github.com/pomm-project/pomm- service-provider https:/ /github.com/pomm- project/PommModule 8 . 1