On 12/9/06, Aaron Trevena <[EMAIL PROTECTED]> wrote:
> 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.
>

Just wanted to say thanks to Aaron and Dave!

CDBI::Plain did turn out to be the solution, although I'd originally
come here with the Loader question becuase swapping out Loader seemed
to break so many things. The advice encouraged me to go back into the
CDBI::Plain (and CDBI, and Untaint, and, and, and, and, and...) docs
and figure out a combination of plugins, BEGIN blocks, and invocation
order that makes everything work without Loader.

Thanks again,

--jay
--------------------------------------------------
This email and attachment(s): [  ] blogable; [ x ] ask first; [  ]
private and confidential

daggerquill [at] gmail [dot] com
http://www.tuaw.com  http://www.downloadsquad.com  http://www.engatiki.org

values of β will give rise to dom!
-------------------------------------------------------------------------
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