"Select Table" shows "No Data" in GUI Mode query

I have a PostGres table as a source and it is successfully pulling in data, but when trying to set up a query in GUI Mode, all I seee is No Data.

The DB credentials are not restricted in any way; it is the master user.

Hey @buzzcolorado!

Happy to help here! Are you able to query any of your tables in SQL mode? It looks like this is the query we run to check for privileges, if you run this does the query return all of your tables as expected?

SELECT column_name, data_type, table_name, table_schema
FROM information_schema.columns
WHERE table_schema != 'pg_catalog'
AND table_schema != 'information_schema'

Hi @Chris-Thompson
I have the same issue, when I ran this query the table was there, have any other possibilities from this issue?

ps: My user is admin too

I created another connection with the exactly same data and It worked.

Has there been a solution to this yet?

Hey @Imcnatt — typically this issue indicates a permissions issue with the credentials used to connect to this resource. If you run the above SQL query do you see all the tables you expect?

I actually found a solution! Turns out I just needed to add a name under Database name in the Resource set up area!

1 Like

Awesome great to hear! :slight_smile:

Thank you! This also resolved the issue for me. I definitely would not have found this on my own.

Running into the same issue. I have db name under connection. I can run the query correctly from retool console and get output. Everything seems to be setup correctly except GUI saying We can't find any tables in this resource. Please select another resource.

I am using planetscale mysql. Not sure if that would be related.

Hey @Amr_Aly!

Can you try opening the network tab of your browser console? When you select the query there should be a request that goes out to get the resource's schema, likely starting with schema?environment=:

Curious to know if you're seeing any errors there.

You also mentioned being able to run the query, is that the query Chris posted? Are you also able to perform any write queries using SQL mode?

Same here

I've got 2 resources with matching database schema.
I can see tables showing up on live, but nothing comes up for our staging db.

the request to schema?environment= returns a 200 and looks fine. Nothing weird on the console.

Notes:

  • I can ran queries in SQL mode without problems, but I'd prefer to use the GUI
  • I am admin and we're using PlanetScale
1 Like

I don't get any errors. I think the issue is related to the connection with planetscale. Also same exact setup is working internal.io

Ahh interesting ok thanks for that context! I'll look more closely at how Retool connects to PlanetScale in particular. Would you two mind sharing your resource setup pages as well? It can either be in this thread or directly via DM/email. Sensitive information redacted of course!

The ssl cert comes from planetscale's support article. The database connection is successful and I am able to run queries from the retool console.

Thanks for that context @Amr_Aly!

After some digging from another team member, it looks like this is a bug on our end. We've filed a report and can let you know here when it has been resolved. Thanks to both of you for surfacing this issue!

Unfortunately, in the meantime, we don't have a workaround for being able to use GUI mode :pensive:

2 Likes

Keep us posted! Thank you

I am also seeing this with a planetscale db. Any idea on the solution timeline?

Hi @Kabirdas,

It sounds like the team probably has a good handle on what the issue likely is, but Travis below reached out to us via PlanetScale Support and shared the following query that Retool seems to be executing currently and I think the modified version below with a few additional exclusions may be what's needed if the intention is to primarily only show the user's tables/columns that might exist in their database?

SELECT column_name, data_type, table_name, table_schema
FROM information_schema.columns
WHERE table_schema != 'pg_catalog'
AND table_schema != 'information_schema' 
-- Additional exclusions:
AND table_schema != 'sys' 
AND table_schema != 'performance_schema' 
AND table_schema != 'mysql' 
AND table_schema != '_vt'
;
1 Like