Unable to start with a new table with no rows

Hi,

I'm using a MySQL database (mariadb) and have defined a new table so it has multiple columns ready to accept new data.

Retool is already connected to my database and other tables are working fine.

I started a fresh "Page".
I created a new query to access the new table (a simple SELECT * FROM...)
The query works fine with "Preview" and "Run" and shows the column names with no rows of data as expected.

I added a Table component to the page and set the Data source to the query mentioned above.

I expect it to show the columns and allow me to add rows to the table by use of the update/insert queries similar to ones I'm already using with other tables.

But all I get is a non-functional Table component with no columns and the following error...

Screenshot 2025-01-26 234344

(I know I could INSERT a dummy row in the table by hand on my server but shouldn't starting with an empty table in Retool be a basic possibility?)

1 Like

Hello @davblo , Welcome to the forum! :wave:

To resolve the issue, you can use formatDataAsArray(data) in the query's transformer to ensure the data is returned in an array format.

image

5 Likes