We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Is there a way to define the database schema?

Hi all,

Looking at my MySQL general log, I see these queries being run for every table Phalcon wants to access:

SELECT IF(COUNT(*)>0, 1 , 0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='request' DESCRIBE request

While I think I understand the rationale behind why this happens (so the model can accurately reflect whatever is in the database), I find it wasteful to add a couple database queries to get something that I can put in a config file.

Is there any way to tell Phalcon what my database looks like so it doesn't have to go find out for itself every page load?

Thanks.

Thank you kindly sir.



1.5k

Link is wrong. How to do it now?