Query tied to original host address for data source

Hi Appsmith community,

I’m very new at this, so I apologize if this is an established question or just naive. I’m trying to get a very simple system off the ground. I’m currently connecting a simple cloud-based Appsmith app to a locally hosted MySQL server via ngrok. All of that is up and working. My problem is that if I start a new ngrok tcp connection and change the data source host address in Appsmith, the Queries I have already written use the original host address of the data source (not the new, updated one). Is there a way to correct this such that a Query is tied to the data source and not to a host address?

Thanks,
Dan

Hi Dan! For each API or query, you can select the datasource you want to tie it to on the right side:

Hi Ameilia, thanks for getting back to me. I think, unfortunately, I wasn’t clear in my question. I have chosen a datasource for my query and successfully tested it. However, if I change the host location of my datasource both on the backend and on the Appsmith datasource entry, the query does not adapt to the new host location.

For example, I create a datasource called MyDS at 0.tcp.ngrok[dot]io port XXXX1. I create a query that uses MyDS as its datasource, and all works well. If I then create a new tcp connection via ngrok, the new host is something like 4.tcp.ngrok.io port XXXX3. I change to the host and port on MyDS and successfully test it. However, the queries I wrote no longer work and give an error that they are unable to communicate with 0.tcp.ngrok[dot]io:XXXX1.

Note that I’m using [dot]=. since new users aren’t allowed to use more than two links per post.

So you mean that you edited your datasource, then clicked Test and Save, but it did not get updated? Can you send some screenshots of the configuration and error you are getting?

I’m sorry for my slow response. I ended up switching to cloud hosting on the Appsmith side and an AWS RDS database, so now everything is working well.

To answer your question for anyone else who might encounter this in the future: Test and Save on the datasource. However, Queries still used the old datasource (not the updated version). If others find this issue (or a similar one in the future), I can try to go back to my old build to reproduce it.