<br><br><div><span class="gmail_quote">2006/5/11, Adrian Rossouw &lt;<a href="mailto:adrian@bryght.com">adrian@bryght.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Now that we have .install files for modules, I believe it is time we<br>extended our database abstraction layer.</blockquote><div><br>True,&nbsp; it should&nbsp; be sufficient to define a table structure only once in the install file. 
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I recommend we create the following extra functions :<br><br>1. db_create_table($tablename, $columns); // columns is an
<br>associative array with the 'name' =&gt; 'type'<br>3. db_drop_table($tablename);<br>3. db_create_index($tablename, $columns); // columns is an array of<br>column names, or just a single column.<br>4. db_drop_index($tablename, $columns);
<br>5. db_add_column($tablename, $column, $type); // PGSQL already has a<br>similar function, but it isn't in both systems.<br>6. db_drop_column($tablename, $column);</blockquote><div><br>These functions are a useful addition, but I am not sure if the developer that defines tables for his module should need to use them. An alternative for the install system could be that the structure of the tables is defined in a xml file that can be validated before it is processed by the install system.
<br><br>Kind regards,<br><br>John Pulles<br><a href="http://mappingwidgets.sourceforge.net">http://mappingwidgets.sourceforge.net</a> | carto module<br></div></div><br>