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

2
  • Possible duplicate of How to use different datasources in a Query using cakephp3? Commented Apr 30, 2016 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. Commented Apr 30, 2016 at 10:05

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.