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

Dynamically switching databases with same schema using Phalcon ORM

Hey, I need to dynamically create new database for each customer. All the databases have the same schema. How Can i switch between that databases (If i know everything about them) using Phalcon ORM? All the databases will be stored on the same database server (postgres).

Well i would recommend to just overwrite current db service with new database name. You can also try use setModelSchema from modelsManager but that would mean that you need database user with access to all databases obviously and im not sure it's good idea.