Cannot do a basic query with Custom Query > Postgres 'Request Failed: error,'

======== TEMPLATE BUG FORM ========

Wappler Version : 3.9.4
Operating System : MAC
Server Model: NODEJS
Database Type: Postgres
Hosting Type: AWS/DOCKER

Expected behavior

What do you think should happen?

I should be able to run a simple SELECT * FROM tablename query in custom formatter.

Actual behavior

What actually happens?

Yes the connection to the postgres DB is active, I can confirm connection, and I can query with the normal Query Manager. I can chec, refresh schema and view tables etc. - It’s just the Custom Query that won’t work.

1 Like

I’m experiencing the same issue also on Mac / NodeJS. Hosting on Heroku but issue is present on both local and Heroku.

1 Like

Bump…
I’m still getting this when previewing a query to create schema structure with custom query.
(Mac M1, W4 Beta 4, Node JS, MySQL)

You shouldn’t develop with your live server as active target. Also develop locally and when done and tested - then just deploy at once.

Custom queries take a full round trip to the server to execute them. In NodeJS world this will also result in restarting the server first. So if you do that on your live server it means that it have to be uploaded, server restarted, then executed etc. Which can take a while and is not very good for running on production server.

That is why we are also considering to prohibit editing server connect action on live targets as well, to also avoid the risk of accidentally breaking your live site.

As said always develop and test locally and when done publish at once to the live remote.

1 Like

Ah! Didn’t realise it was caused by target selection. Makes sense - I agree that prohibiting makes sense as it doesn’t work anyway with live connection.

It feels like it’s time to completely separate dev from targets so they aren’t connected at all. Now that staging and production are prevented from page saves, maybe they become something different? I still make the mistake of pushing to production, walk away, and then sit down to develop and wonder why my changes are not reflected.

Ideally we could always be in develop mode and then without leaving that, push something to staging or production targets (of which there might be several).

Slightly related, the settings for each of the targets could also be centralized — today some target settings are on the project settings and others (like stripe keys) are on the server connect great settings.

1 Like

Exactly my thoughts Ken. Just haven’t figured out the most perfect deployment UI flow with live target selection yet.

Ideas are welcome.

I think I also fell into this trap (rookie error) -

Since you asked for ideas -
Rather than stopping making edits (or in addition to), perhaps a more visual way of showing what target you are working on?
Maybe a colour change in the UI? I do this with WordPress development and change the status bar colour for development, staging and live versions.

I am having this issue, I am working locally and have on my project settings development, it is not allowing me to do a simple select * from tablename is not working, not sure if there are steps before but followed the documentation, and I need to join tables, but if a simple select is giving me this same error what am I doing wrong?

The solution is given above, please stop reviving old topics.