Re: Class::DBI::Loader suggestion
[prev]
[thread]
[next]
[Date index for 2004/06/30]
The main problem I have when using generic modules that get teh tables
automatically is, that they arn't able to get just the tables created by
me, but also get all the system tables. I think the Loader-modules
should, by default, load just these tables.
A way to tell it which table sto load would also be nice
(CDBI::AutoLoader has it), but in my opinion, the nice thing on using
Loader-modules is that you should be able to provide as less information
as needed and have everything done for you.
What do the Postgres-specific applications like pgadmin use to identify
the tables the user created from the list of all tables? It would be
nice to implement something like that.
Gabriel Horner wrote:
> To whomever uses Class::DBI::Loader,
> I, like a few other Postgres users, came across two stumbling blocks
> when trying to use Class::DBI::Loader. While fixing them (I'll send a
> patch soon), I noticed that CDBI::Loader tries loading all tables in a database.
> Wouldn't it be more helpful if you could specify only certain tables to load?
> This not only would help the probability of more successful installs but would also help
> for cases where one has many tables in a database or has a few Class::DBI uncompliant tables
> in a database.
>
> Here's what you'd have to do to implement this:
> 1. Add an extra tables_to_load attribute to the CDBI::Loader::Generic object
> 2. Change the logic of the subclassed modules' _load_classes() so that
> it iterates over specific tables if they're defined.
>
> I'm sending this to the author as well but am wondering if others' would like to see something like
> this.
>
> I'm including a script below which does allow defining only certain tables.
> I also redefined _load_classes() so that it could be called from the script to load
> additional tables when needed.
> I could give the changes in patch form if we'll upgrade the modules but I
> thought it'd be easier to run this script than patch and unpatch CDBI::Loader
>
> Later,
> Gabriel
>
--
Grüße,
Andreas Fromm
|
|
Re: Class::DBI::Loader suggestion
Andreas Fromm 07:11 on 30 Jun 2004
|