0

I would like to use two separate databases for a cakePHP application. I will need to execute queries that join tables from the two databases. Is this possible in cakePhp?

I know you can have multiple data sources in cakePHP and switch connections. I am using SQLite presently but would like the solution to be database agnostic if possible.

There is the ATTACH feature of SQLite databases, but I'm not sure if that's the correct approach. Is it possible to bake models for both databases? Does the attachment need to occur on every request?

In this similar question, a finderQuery is used but the database is not SQLite.

Thanks

Community
  • 1
  • 1
Elfalem
  • 347
  • 3
  • 17
  • Possible duplicate of [How to use different datasources in a Query using cakephp3?](http://stackoverflow.com/questions/32033558/how-to-use-different-datasources-in-a-query-using-cakephp3) – ndm Apr 30 '16 at 10:03
  • There is no 100% platform independent way, as mention in the linked answer, you have to take additional measures depending on the used DBMS. – ndm Apr 30 '16 at 10:05

0 Answers0