On 07/12/06, Jay Savage <[EMAIL PROTECTED]> wrote:
> Hi, all!
>
> I'm trying to set up a Maypole app to work with our MySQL database.
> One of the 'tables' isn't a table; it's a view. CDBI::Loader doesn't
> like that very much, because views don't have primary keys, and setup
> fails with:
>
>    instructors has no primary key at .../Class/DBI/Loader/Generic.pm line 164
>    BEGIN failed--compilation aborted at admin.cgi line 9
>
> Is there some way around this? Other apps use the database, so
> deleting the view isn't an option.

I would suggest looking for a usable compound key in the view ( i.e. a
combination of columns that make up a unique set ), and using the
CDBI::Plain model, and writing explicit classes.

I don't recomend using created-on-the-fly classes for development or
production, I have a script that is similar to what C::DBI::Loader
does but instead creates the classes with boilerplate/skeleton pod and
validation.

cheers,

A.

-- 
http://www.aarontrevena.co.uk
LAMP System Integration, Development and Hosting

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Maypole-users mailing list
Maypole-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/maypole-users

Reply via email to