It would also be interesting if the database engine could read and use environment variables.
Let me explain: I’m using Wappler to build a system similar to WordPress but on a much smaller scale. Currently, it’s used in an environment where the connection details are known, but there’s a growing need to migrate to a cloud provider that doesn’t provide access credentials—instead, they provide a databaseurl and userdatabase. At least I can’t figure out how to make it use this type of connection in PHP, and it would be useful.
If this feature is already available, please forgive me—I just can’t seem to find it.
You just reminded me of one @Juan_carlos_R
- Use a .env file rather than the Wappler config, PLEAESE!
Using a configuration file wouldn't work. I've already tried it with Cloudflare Page Functions, Azure, AWS, and Replit. If the implementation isn't done in the code, it won't work. Of course, it could also be that I'm not doing it correctly.There is nothing in the documentation related to what I am looking for and I don't feel capable of creating an extension.I apologize if I have used any incorrect expressions; English is not my native language.
Why not put a help post out with more detail, maybe someone in the community can help or at least the team will understand the issue.
I've split the topic so we can discuss it here instead of in the Wappler 8 wishlist topic.
My .env request was for Wappler to adopt .env file over the current everything in the Project settings area. More of an industry standard approach to storing sensitive variables. Or allow us the ability to specific a .env route? Not specifically for database connections.
![]()
It is already possible to use environment variables for database connections but they don't show up in the data picker. You can only use expressions when you configure the connection in the workflows panel under the globals database connections.
For PHP we don't have an alternative for the .env file like with nodejs at this moment.
I personal think that we should not support the .env file but instead set environment directly on the server. You mostly store there credentials that doesn't belong in the source code. Since Wappler has its own development servers it can pass those environment variables and store them secure outside of the source code. For remote servers you set them directly on your hosting provider.