propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

Use multiple connections #1970

Open cruzprojects opened 1 year ago

cruzprojects commented 1 year ago

How can I use more than one connection in the same php application using Propel2? For example, one for MySql and other for PostgreSQL, both at the same time.

mringler commented 1 year ago

The documentation has examples how to set up multiple connections. Then you define a database-element in schema.xml for each connection, they are bound to the connection via the name attribute. The archivable behvavior documentation has an example where a second connection is used for storing backups. I have never used it myself, so I can't tell you how well it works. Feel free to share how it is going.

floriankraemer commented 1 year ago

@cruzprojects how is it going? Does it work for you?