[CDBI] Turning Class::DBI on its side

Duncan Ferguson duncan_j_ferguson at yahoo.co.uk
Wed Jul 25 14:54:22 BST 2007


We have already done this and it works fine.

The problem with it is every time I want to add a new config var i  
have to add a new column to the database, and some of the config vars  
have defaults and I only want to save the var if it has changed.  The  
management of the table will get problematic the more vars I want to  
save.

At the least, having 50 or 100 columns for just one row of the table  
doesn't 'feel right' to me, but if its the only way to go then I'll  
have to put up with it.

Thanks.

   Duncs

On 25 Jul 2007, at 14:43, Dave Howorth wrote:

> Duncan Ferguson wrote:
>> Bit of a strange cry for help this (not written a module before so  
>> some
>> of my terminology is probably off, sorry)
>>
>> I want to turn the Class::DBI objects on their side; I want to store
>> some application configuration within a database table, i.e.
>
> Instead of turning Class::DBI on its side, why not just turn the table
> on its side?
>
> Table: prefs
> +----+-------------------+--------------+-----------+
> | id | filename          | item_enabled | task_name |
> +----+-------------------+--------------+-----------+
> |  0 | /path/to/file.txt |            1 | something |
> +----+-------------------+--------------+-----------+
>
> Then the accessors will JustWork (TM)
>
> Cheers, Dave
>
> _______________________________________________
> ClassDBI mailing list
> ClassDBI at lists.digitalcraftsmen.net
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi



-- 
Duncan Ferguson

Opsview - Making Nagios Easier

http://www.altinity.com
Tel: +44 (0)870 787 9243
Fax: +44 (0)845 280 1725
Skype: duncan_j_ferguson
MSN: duncan.ferguson at altinity.com





More information about the ClassDBI mailing list