Wappler Version : 4.9.1
Operating System : macOS Monterey 12.4
Server Model: nodejs
Database Type: postgres
Hosting Type: Wappler Local Server
Expected behavior
What do you think should happen?
When I add a database connection I should be able to use it
Actual behavior
What actually happens?
When I add a database connection and test the connection, everything is OK.
However, when I try to use the connection in a database query it says "No Valid Database Connection found! Please define it first in the Database Manager for this target"
When you look at the connection in the Database Manager there is an alert icon which says: "Cannot set property 'users' of undefined"
There is only one table in the database and that happens to be the one it's complaining about "users".
How to reproduce
Add a new database connection
Test the connection - OK
Go to Database Manager and observe the warning message
I’m having the same issue using Wappler 4.91 on Windows 10
I create a new project, choose Docker and NodeJS.
In Project Settings, Database, I choose Postgres and leave everything as defaults.
On Saving Project Settings all the alerts look good and I have a full green circle against my ‘Target: Development’.
But when I open the Database Manager, the db, tables and views have a red circle with an exclamation mark and the hover over says ‘Cannot set property ‘cars’ of undefined’
There are no ‘Changes’ in the database.
Any pointers would be much appreciated.
Are you using the direct database connection?
When you’re working with Api section (for example, create a query) you must have the database under globals.
How is your configuration in globals - database connections - aws?
its pointed to local?
I use localhost in database server address and my domain in the target server url and works fine for me…
In the global database connection (check the title, is not the "direct database connection")
Change the host to: localhost, test connection, and try to make an api query
I dont know if aws works similar to others, but in some cases, you should give your ip on the trusted sources list, to allow the connection directly to your database like Cpanel uses “remote mysql”.
But, that is for direct database handling, not for creating apis on your site.
I appreciate the help, but the steps I’ve performed are the same ones I’ve done a bunch of times, and it always worked before.
Changing the host to localhost is not going to work as I don’t have a database running locally. I have other projects that access the same AWS database and they work fine.
There’s clearly a new bug that’s been introduced in setting up a new connection in a new nodejs, docker & postgres project.
Are you sure you have the correct server defined in the target option?
Of course it can be a bug, in that case i hope the team can read your post soon.
I’ve managed to make some progress. I clicked through to Tables (which was empty) and right clicked -> Refresh Schema. This brought up my users table which I’m now able to run queries against.
However, the alert and error message is still there.