[development] Extend database abstraction layer, to include table creation.

Jeff Eaton jeff at viapositiva.net
Thu May 11 19:41:32 UTC 2006


> On Thu, 11 May 2006 20:31:32 +0200, Adrian Rossouw 
> <adrian at bryght.com>  
> wrote:
> 
> > http://drupal.org/node/63049
> >
> > Now that we have .install files for modules, I believe it is time we
> > extended our database abstraction layer.
> >
> > I recommend we create the following extra functions :
> >
> > 1. db_create_table($tablename, $columns); // columns is an 
> associative
> > array with the 'name' => 'type'

Why 'name' => 'type'? I'd think that 'name' => 'foo', 'type' => 'foo',
'default' => 0, and so on would be a beter way to capture all the extra
stuff necessary.

Chx makes a good point, though, that data column types differing between
implementations is one of the ugly bits. It'd be odd to set up our own
'drupal-esque' data types and map them to db specific types in the
function.

--Jeff




More information about the development mailing list