Problem fetching tables without a direct database connection

I would like to know the motivation of this difference between 2 projects, for a target local development
The Target Development of the first project not by errors and is ok


The target development of the second project instead produces an error and does not pass the test


Until two different providers servers, perhaps this is the reason?

@Teodor
I tried creating a new test project to test the local development target, but it didn’t work

So what do you expect to happen here?
You select Own Server and create some project folder at a random location on your hard drive. If you don’t have a server running there, of course it won’t work. Own Server option expects you to have a server up and running at the specified location at the specified address/url.

Thanks Teodor
I wanted to avoid the use of Docker for the local server because I thought it could be done, since I have an old project that seems to work without Docker.
In fact, if I copy the URL address of that site in the local target of a new project, the connection seems to work

You don’t need docker… you can either use Wappler local server or just install a local WAMP/MAMP server.

I would prefer to use Wappler server for the local, but I don’t know if I can change the local development target setting for a project already set with the target productions and staging working

However, it is strange that with the URL address of that site, it works in others all projects (with Own Local Server) the local development target
In any case, I can’t change the Own Server to Wappler Server

It is impossible to change the local server, so I created a new project from scratch and now all connections work correctly
(Local, Staging, Production)
Thank you

Sorry Marzio, i don’t understand what do you mean.
Just setup your project and the different targets properly. Its been discussed in many topics already, including different topics you created about the same thing.

maybe I expressed myself badly
Wappler after creating a new project with Own Server, then no longer accepts the variation of the server
So I recreated the project with Wappler Server and or solved the problem

@Teodor

Hi Teodor
I’ve tried numerous times with different settings, but unfortunately I can’t get the project’s database connections to work
I start from the fact that I have two twin databases on the provider’s server, one intended for production and another intended for staging and possibly also for development
Here I report the setting of the project options and the 3 perfectly functioning targets

PROJECT OPTION

3 TARGET OK



The problem is that the remote database for production is the only one that works. If I use the Production target the database connects

REMOTE DATABASE FOR TARGET PRODUCTION - OK CONNECT

However, as far as databases for staging and development are concerned, I really can’t figure it out
I have a second database (also remto) connected to the subdomain used for staging
As far as the database for development is concerned, I really don’t know which solution to use. Create a new database for Wappler local server or use the same as staging.

I’m a little confused

You need only one connection created.
It’s explained in the docs how to change this single database connection settings PER TARGET:

What this tutorial shows:

  1. Switch to your local target

    • set the database connection settings for the local target
    • save
  2. Switch to your staging target

    • set the database connection settings for the staging target
    • save
  3. Switch to your remote target

    • set the database connection settings for the remote target
    • save

I really don’t know how to explain this process simpler than that. It’s already in the tutorial and i already sent this to you multiple times.

1 Like

but this is what I do, I have two remote databases available, with different names and passwords
I assigned the first to the Production target, the second I tried to assign to the Staging target and/or the Development target
but it doesn’t connect and produces an error
Your tutorial is perfect and I followed it to the letter

@Teodor

Sorry Teodor, but I followed your instructions and I’m sure I didn’t make a mistake, also because it’s very clear
However I just can’t setup a local database.
As I pointed out previously, I have three targets (Development, Staging, Production) and I have two remote databases available on the domain server.
I created three different database connections in Global:
db_production - database 1 (OK)
db_staging - database 2 (OK)
db_development - I can’t get it to work

I restarted Wappler several times and tried to match database 2 to db_development, but the error occurs
I really don’t know why it doesn’t work since it uses the same settings as Staging database 2
I really don’t know how to do it

Schermata 2024-04-18 alle 11.21.49

That’s totally the opposite of what i explained you. You should only have 1 (one) database connection in the project, no 2 or 3 or 10. Only one.
I really can’t help if you are doing exactly the opposite of what my posts say.

Sorry Teodor, maybe I expressed myself badly
The database is unique and is called db
then I have 3 different settings depending on the three targets
For each target, change the name and setting
If I choose the Production target it is OK (database 1)
If I choose the Staging target it is OK (database 2)
If I choose the Development target (database 2) ERROR

Try changing the address of the database to 127.0.0.1 instead of localhost

The same error

Then most probably the database connection details you are entering for the development target are wrong.

No, they are the same as the Staging target