PEAR MDB2 updates (FOREIGN KEY support!)
Abstract: Some updates on recent MDB2 developement: FOREIGN KEY support in the Manager and Reverse modules, etc. Also: updated SQL technical articles on INFORMATION_SCHEMA for Firebird, PostgreSQL, SQL Server and Oracle.
I recently committed to CVS some changes to add full FOREIGN KEY constraints support to PEAR::MDB2, both in the Manager (
createConstraint()) and in the Reverse module (
The constraint definition is translated to this array structure (some key names could change slightly before an official release, so they are in sync with MDB2_Schema):
array ( [primary] => true|false [unique] => true|false [foreign] => true|false [check] => true|false [fields] => array ( [field1name] => array() // one entry per each field covered by the constraint [field2name] => array() [field3name] => array( [sorting] => ascending|descending ) ) [references] => array( [table] => name [fields] => array( [field1name] => position //one entry for each referenced field [field2name] => position [field3name] => position ) [deferrable] => true|false [initially_deferred] => true|false [on_update] => CASCADE|RESTRICT|SET NULL|SET DEFAULT|NO ACTION [on_delete] => CASCADE|RESTRICT|SET NULL|SET DEFAULT|NO ACTION [match] => SIMPLE|PARTIAL|FULL );
The next step will be adding CHECK constraint support. If you feel brave enough, please fetch the CVS version of MDB2 and give it a go. And of course send me some feedback ;-)
Updated INFORMATION_SCHEMA tutorials
On a side note, I've updated my tutorials on INFORMATION_SCHEMA and system tables for Firebird/Interbase, PostgreSQL and SQL Server, and added one for Oracle:
- Interbase/Firebird INFORMATION_SCHEMA
- Oracle INFORMATION_SCHEMA
- PostgreSQL INFORMATION_SCHEMA
- SQL Server INFORMATION_SCHEMA
- PEAR MDB2 2.4.0 released
- PEAR MDB2 2.4.1 released
- Catching up - July 2007
- PEAR MDB2: FOREIGN KEY support is complete!
- On batching vs. latency, and jobqueue models
- Updated Kafka PHP client library
- Musings on some technical papers I read this weekend: Google Dremel, NoSQL comparison, Gossip Protocols
- Historical Twitter access - A journey into optimising Hadoop jobs
- Kafka proposed as Apache incubator project
- NoSQL Databases: What, When and Why (PHPUK2011)
- PHPNW10 slides and new job!