Home » Database » DB_DataObject » Bug #2086
[Documentation] Auto Building Views
Details
| Request #2086 | [Documentation] Auto Building Views |
|---|---|
| Submitted | 2004-08-08 01:55 UTC |
| From | ylf at xung dot org |
| Status | Closed |
| Package | DB_DataObject |
| PHP Version | 4.3.4 |
| OS | Linux Debian (testing) |
| Roadmaps | (Not assigned) |
Comments
[2004-08-08 01:55 UTC] ylf at xung dot org
Description:
------------
Hi,
I'm using Postgresql's views, but DB_Dataobject_Generator does not handle them. Adding this feature is pretty interesting for Postgresql, since using its rule system, views get INSERTable, UPDATEable, etc... so that it even makes sense to use the Formbuilder against them. I guess this is true for other feature-rich rdbms as well.
I actually addded two lines to Generator.php :
159a160,161
> if (@$options['build_views'])
> $this->tables = array_merge ($this->tables, $__DB->getListOf('views'));
This creates a build_views option.
Unfortunately, DB_pgsql is buggy about listing views, and the second line of code above appends a lot of Postgresql internal tables to the tables array.
I posted bug #2085 with a patch attached for this DB specific issue.
Once this patch applied, views are correctly generated along tables, on my setup.
--
Olivier Guilyardi
Packages versions :
DB 1.6.5
DB_DataObject 1.6.1
[2004-08-11 12:44 UTC] ylf at xung dot org
That's nice.
One last point : the generator can not identify primary keys when working on views. This is inherent to the views, and the only way is to modify the generated .ini file manually to specify the key.
I think it would be helpful that you talk about this issue when documenting the build_views option.
--
Olivier Guilyardi