Can i do a direct query to my production DB in the cloud?

2
Hi Here Can i do a direct query to my production DB in the cloud? I want to retrieve one table from my mendix production db. I need the Server URL port DB Name and username and password. Like this which i did on local. Regards, Patrick
asked
3 answers
3

Yes, you can do a direct sql query through the mendix runtime java api: https://apidocs.mendix.com/7/runtime/com/mendix/datastorage/DataStorage.html#executeWithConnection-java.util.function.Function-

Some example java code can be found here: https://github.com/ako/QueryApiBlogPost/blob/master/readme.md

answered
1

In the Mendix cloud you cannot do a direct query on your mendix database.

In that case your can query thought the runtime, by exposing a web/rest service or exposing a table with OData.

 

answered
1

Not exactly what you are looking for but close:

  1. Create a backup from your prod db
  2. download it
  3. restore it in a local db
  4. run any queries you want on it

This way you do not affect the prod environment in any way, you will not change data by mistake, and you will not add extra load on the db by executing complicated or long lasting queries.

-Andrej

answered