Some weird bug in query array

wappler 6.5
php / mysql / docker / windows

hi
i have a single query that is custom sql. it returns 1 record, I can see it returns 1 record in th query builder.

in server connect it is returning an array as i can see the [0] in inspector. It means i cannot select the data to show :frowning:
I have tried everything I can think of, checked sql over and over, 1 record. I have renamed the query, renamed the server connect, restarted wappler etc etc. it was working, returning 1 record, then whilst making some changes it returned 2 records, i fixed that to only return 1 record and now it seems stuck expecting to return an array.

is there some cache or something I need to refresh/clear to get it working again

Is this the problem that needs solution? I’m very confused :sweat_smile:

If that’s the problem, there’s no problem, by nature it’s an array with 1 element

yeah, sorry, the data picker doesn’t see it as an array so just picks a non array (and thus does not display)

i also just thought i would setup new query with same sql and got this warning, not sure what it means

It means you need to run the test query so it can obtain the schema

Hope someone can help you with your problem :slight_smile: (I don’t think I fully understand, and I lack the time to help)

no problem, i got it working for now using the to reference it as an array and using parameter in the query, just very odd as its a single query select that returns 1 record not an array

From a computer science perspective it makes sense to be an array, because the query itself doesn’t have any hard assurances it needs to return only one result. The Wappler step to fetch only one result is probably special treatment. Your custom query is missing a LIMIT 1, but I don’t think the addition of that will change the data type to be returned, which is still going to be an array

Hello James

What do you mean by this?