To call it an arbitrary limitation is a bit harsh. Having Cake support queries and associations across multiple databases would be a cool feature but I struggle to find a very good reason for willingly design an application in this way. CakePHP was never designes to be compatible with any and all legacy databases possible.
Can you explain why you would want to design an application in this way? You are in a great position to take a stab at extending CakePHP's Model class (and probably dbo classes?) to handle this. I can vaguely see how it might be done but you would definitely loose backwards compatibility. All Models would have to be prefixed with its database "Data1.Table1.id" or you would probably very quickly run into naming conflicts. In database.php I would make the "database" value into an array 'database'=>array('data1','data2') Then you would have to modify the sql-generating methods to take the database into account. I have no idea how many database-engines support this? Is it supported by all common SQL databases Cake has engines for? /Martin On Sep 23, 3:10 pm, Rick <[EMAIL PROTECTED]> wrote: > As I said before I do NOT want to use raw queries. > > Seems like Cake is applying arbitrary limitations. Do any of the > developers read these posts? > > Be nice to have an opinion from one or more cake developers. > > Rick > > On Sep 23, 3:00 am, Bookrock <[EMAIL PROTECTED]> wrote: > > > Thanks for your suggestions. > > > Raw queries for multiplae datbase is working fine $this->query("select > > * from caketoodoo.tasks as t2, test.stores as t1 where t2.id = > > t1.id"); > > > But my database name is depends on user input. How can I set > > $useDbConfig variable value. > > Like I made a module Task and controller TasksController. Suppose I > > get database name from URL and set $this->Task->useDbConfig = > > 'multiple'; (here , multiple is datbase name) that is already > > configure in datbase.php > > var $multiple = array( > > 'driver' => 'mysql', > > 'persistent' => false, > > 'host' => 'localhost', > > 'login' => 'root', > > 'password' => '', > > 'database' => 'caketoodoo', > > 'prefix' => '', > > ); > > > then it show error Database table tasks for model Task was not found. > > because task module not getting value of useDbConfig. > > > Please tell me how can I set useDbConfig value from controller or is > > there any other way to pass datbase name for module. > > > Thanks > > > On Sep 22, 9:17 pm, Rick <[EMAIL PROTECTED]> wrote: > > > > Anotherdatabasereally isn't an option as I said this is an existing > > > MySql instance. > > > > Yeah, I could do raw queries but I wanted to taste the cakey goodness. > > > > Rick --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---