Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Adding simple singleton pdo connection


Although ORM is good and it does what I need in 80% cases but in few areas I do need simple sql to run advanced query or simple for ajax search (dat orm search is a bit slow) for this purpose.

Is there any link on elegant inserting pdo connection to the di and using it?


Call getInternalHandler on the Phalcon connection to have it return a PDO. That way Phalcon can set everything up with the dependency injector.

The ORM isn't going to be slow as it uses SQLite tech and its code is written in Zephyr. Also the only thing that I've found won't work for me is complicated joins with multiple tables and the solution for that is to disable implicit joins with enable_implicit_joins on the project level with Model::setup or just for the one query.

Unless you really know what you are doing it is probably too early to say if Phalcon is too slow for you. You can cache the table meta data and searches as well.