Explanation of Database Connection

Hi,
Can someone educate me about the differences between what appears under Workflows > Globals > Database Connections and what appears under Database Manager > Database Connections? Why do we need two?

Also, in the server actions steps dealing with Database Actions, there is usually a field to populate called Connection, with a dropdown. Which of the two “Connection” concepts above is used here?

Not sure if it’s relevant, but I’m using Wappler 6.3.1 and the PHP server model.

Many thanks in advance,

Alex

Hi Alex,

The first configuration is for the PHP website. The second configuration is for the Wappler editor program, so you can manage the database from it, such as viewing data and running changes/migrations.

Regarding the dropdown in Server Actions, it uses the configuration for the PHP website.

Thank you so much for the prompt answer.

I don’t understand something then: If I delete the database connection under the Database Manager, why do the the DB steps dealing with Database Actions in a server actions show a blank? If they are using the Global definition, and I did not touch it, what I saw should not happen, right?

Alex

1 Like

You’re probably correct, it’s probably a bug, though unnoticed so far because no one really did the same as you did (delete the database connection, or use a different config for a 2nd database)

The option to select DB connection is populated from the globals, but actually building the query using query builder or even custom query, requires the same named connection to be present in the DB manager.

In other words:

Any DB related stuff happening in Wappler requires DB manager to have a connection.

The DB connection required for running the app comes from Globals, and DB manager connection has no implication here.

This is from my understanding and what I have read on community. There is no official doc explaining this stuff, as far as I know. There are confusions around per-target-connections, deployment connections etc as well - as it has been changing over the years as more features got added.

Thx Sid,
Yes, the lack of documentation does not help here.

Thx all in the community for the help!

Alex

I’ll be curious to see what that bug is. I use Navicat to do all my database building and don’t have any problems yet refreshing the schema in the Manager.

Hi Brad,
It was an odd thing, and I’m not even sure that it was a bug yet. If I can reproduce it, I’ll post it. As you can see, I edited my previous post to remove the reference to this “maybeabug”.

Alex