Insert data directly to external database

How can I insert the data directly to Retool database?
For context, I'm using self-hosted Retool with an external PostgreSQL database. I created a table in the database to see if it would appear in Retool, but it didn't show up. I also query all the tables from the database but didn't see any tables that I created on Retool, wondering how it work.

Hi @ducnta,

Are you trying to connect your external PostgreSQL database so you can see it in retool's database? If so, I don't think this is how retool's db tables are intended to work (at least not natively). Retool's DB is a PostgreSQL database on its own, and it can be either used for all of your apps, or to test new prototypes and data flows.

It seems to me that you were able to connect your external PostgreSQL database to retool using a resource, right? If so, you will be able to use that in your apps, and update it directly. But if you want to get that information into retool's db you will have to do either a manual migration, or set up processes so that they sync (I have no idea how to achieve this though).

Sorry if I'm missing the point of your question completely!

1 Like

I just figured it out. It turns out that Retool creates a different database on the host. I simply copied the credentials from the Retool database connection string and was able to create and insert records with my code.

2 Likes