[Dbix-class] Relationships across different databases

Matt S Trout dbix-class at trout.me.uk
Wed Nov 22 17:11:37 GMT 2006


apv wrote:
> I ask to save myself a couple of hours of playing with code in case it 
> won't work; just thinking out loud and it seemed like an interesting 
> point either way; sort of forced pair coding.
> 
> Can I have a relationship across databases?
> 
> What I'm considering doing is using SQLite for a chat db/table but I'd 
> like it to be able to reference users (with belongs_to) from the "real" 
> MySQL db the rest of the site runs on.

Can't do that, DBIC expects any relation to be a *real* relation, i.e. one it 
can join on.

There's nothing stopping you having a second $schema and an inflate_column 
that "looks" like a belongs_to though.

Alternatively, just turn on the InnoDB option that makes each table its own 
file and maybe for added bonus points do multiple dbs within a single mysql 
instance - which -does- work.



More information about the Dbix-class mailing list