whats the best practice to use model with multiple db connection
4 years ago
4 years ago
#1
i would like to ask if anyone tried connecting to multiple db connection with trongate?
4 years ago
#2
I haven't personally, but can't see why you couldn't with the use of the built-in model copied to turn it into a generic one. Could be a good project to add to the module market too.
4 years ago
#3
Simon's right about coping the model and creating a module, something like Aux_db_connection
Make sure you have security here.
Then have your db connections either hard coded in the controller, or use a variable if you have more than one.
Then put the copied model under that. Modify it as needed. Or just use sql to call the Aux_db_connection and return the query.
Make sure you have security here.
Then have your db connections either hard coded in the controller, or use a variable if you have more than one.
Then put the copied model under that. Modify it as needed. Or just use sql to call the Aux_db_connection and return the query.
4 years ago
#4
I just came to the Help Bar to ask if I can use Trongate to get and insert data from a different MySQL database. From reading above it looks like the answer is 'not by default, but it's possible. From the documentation. Looks like I got the leads that I need to make my own database module.
4 years ago
#5
cisnez, also see this thread. https://trongate.io/help_bar/thread/FK96dUe9y55H