[Dbix-class] Emulating CDBI "temp" columns

Brandon Black blblack at gmail.com
Fri Jul 21 18:39:09 CEST 2006


On 7/21/06, Drew Taylor <taylor.andrew.j at gmail.com> wrote:
> On 7/21/06, Brandon Black <blblack at gmail.com> wrote:
> >
> > Check that...
> >
> > My::Schema ISA DBIx::Class::Schema
> > My::Schema::User ISA My::Schema::BaseClass
> > My::Schema::BaseClass ISA DBIx::Class
>
> Brandon,
> As I just replied to Christopher, the problem was happening when
> load_classes() tried to load My::Schema::BaseClass, which has no
> table/column definitions. What are you doing in your base class that
> you don't get the error I was initially getting?
>

Nope, I'm specifying all of mine individually (64 of them right now).

Its definitely something that needs to be looked at going forward.  It
would be really nice if we could come up with a mechanism for
partitioning the namespaces underneath a Schema class as a new
optional way of doing things.

For instance, we could set it up so that My::Schema::ResultSource::*
are loaded as sources, My::Schema::ResultSet::* are loaded as the
resultset_class of the corresponding sources (and in the case that a
source doesn't have a corresponding resultset class, we build one at
that namespace which just ISA DBIx::Class::ResultSet), but they're
available via short monikers like $schema->resultset('Foo') still.
Then you can put your bases elsewhere, like My::Schema::SourceBases.

We could probably set up a loading scheme along these lines without
disturbing the existing ways of doing it by just providing a new
method to do it this way, like load_class_namespaces() or something.

Just some random food for development thought.

-- Brandon



More information about the Dbix-class mailing list