Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-18-2008, 08:40 AM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Lightbulb Schema separator in Zend_Db_Table_Abstract and Zend_Db_Adapter_Abstract (patch???)

Hello Everybody!

I'm really happy of seing Zend_Framework 1.5 up!
I'm developing a (not so) little project for a little publishing house, and I choose Zend_Framework 1.5 when it was yet RC1... (being a bit afraid for it's stability).
Now it's stable, I'm far more happy of my choose!

Going to my request, I'm developing on a DBMS which doesn't support schema definition (aka MySQL).
But, for many reasons, I need a system which could work in PostgreSQL too, by simply changing the adapter.
Moreover I NEED to use the schema abstraction (mainly for keep clean namespaces).

Now to simulate the schema in MySQL I thought to patch the Zend_Db_Adapter_Abstract by adding a protected attribute called Zend_Db_Adapter_Abstract::$schemaSeparator (default to ‘.’) and a public method Zend_Db_Adapter_Abstract::getSchemaSeparator()

Then to modify the methods

PHP Code:
Zend_Db_Table_Abstract::_setupMetadata() 
Zend_Db_Table_Abstract::_setupTableName()
Zend_Db_Table_Abstract::_setupPrimaryKey()
Zend_Db_Table_Abstract::insert()
Zend_Db_Table_Abstract::update
Zend_Db_Table_Abstract
::delete()
Zend_Db_Select::__toString()
Zend_Db_Select::_join() 
to use $this->_db->getSchemaSeparator() instead of ‘.’

This way, you could extend the adapter you want, and by setting the $schemaSeparator attribute (say with '__') all the rest will work with tables named as schema__table1 schema__table2 and so on...

I know I could simply extends all those objects, but since this is a patch which could be useful to others (and seem to not have backward compatibility issue), I prefer to contribute the framework.
(also becouse I'm lazy, and don't want to monitor the Zend_Db module for such a patch submitted for someone else).

Btw, I don’t know how to submit this patch (as you can see, quite easy to write).

Obviously it’s not the same of having a real schema DBMS, but some time this could help.


Can you help me?
Have you some suggestions?


Thank you all!


Shamar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 03-18-2008, 02:42 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default

Here I write a patch for this: http://dev.tesio.it/patch.Zend_Db

Some one could tell me how to contribute?
Some one could send the patch for me? I don't need the glory... ;-)


Shamar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-18-2008, 05:44 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

You can learn how to contribute this back on this page: Zend Framework: Community
__________________
- xentek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 03-19-2008, 02:01 PM
Junior Member
 
Join Date: Mar 2008
Posts: 3
Default

Thanks xentek!

I created this issue attaching the patch: [#ZF-2921] Allow defining of the schema separator in Zend_Db_Adapter - Zend Framework Issue Tracker

I've also sent the Individual CLA signed.

Do you know what I've to do now?


Shamar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 03-19-2008, 02:15 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

I think you wait . I believe you can email cla@zend.com to find out if your CLA was accepted, etc.

Keep checking back on the issue you filed to see if a conversation picks up around it. You may need to convince people of why you think the patch should go into core.
__________________
- xentek
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:55 PM.