Newbie again.
I searched a lot of the forums, but I don’t get it:
The challenge:
Local Development, local database
Remote Server, different database (in this case Railway, but it doesn’t matter)
What exactly do I have to do to get my project published (to an external folder_ with different database settings for production?
The docs and the forum are not a great help for a beginner, as they refer to different versions and features who work / behave differently.
What I tried:
First and obvious: I entered the DB details on a new target. After publishing to the local folder, still localhost in the connections.
Went to the database manager, added a new database connection (was recommended somewhere, didn’t understand exactly what it does, but hey: I could connect to my remote database from within the database manager. Btw, after deleting them, I get tons of error messages in the logm see below *1 )
Found a how to and a video somewhere where I can switch between my targets (bottom right of the window) and enter different settings. Seems legit, but no: under connection properties → connection options the last entered dabase settings are visible → doesn’t work for me?
Edit: Define Database Connection Settings per Target
Next try: Database Manager, selected my database, pressed Direct Database Connect and entered my details (e.g. localhost), then switched to my other target and I could enter new connections setting who are switching. However, it doesn’t change the database settings for the published project.
*1 Error from the console when switching targets:
TypeError: Cannot read properties of undefined (reading 'type') at r.delete (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:108014) at Object._execute (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.contextmenu_fontawesome.js:8:4351) at HTMLAnchorElement.<anonymous> (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.contextmenu_fontawesome.js:8:11516) at HTMLUListElement.dispatch (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5430:27) at HTMLUListElement.elemData.handle (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5234:28) at HTMLUListElement.sentryWrapped (/Applications/Wappler.app/Contents/Resources/app/node_modules/@sentry/browser/dist/helpers.js:75:23)
TypeError: Cannot read properties of undefined (reading 'type') at r.delete (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:108014) at Object._execute (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.contextmenu_fontawesome.js:8:4351) at HTMLAnchorElement.<anonymous> (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.contextmenu_fontawesome.js:8:11516) at HTMLUListElement.dispatch (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5430:27) at HTMLUListElement.elemData.handle (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5234:28) at HTMLUListElement.sentryWrapped (/Applications/Wappler.app/Contents/Resources/app/node_modules/@sentry/browser/dist/helpers.js:75:23)
TypeError: Cannot read properties of null (reading 'data') at refreshSchemaForNode (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:163294) at HTMLButtonElement.<anonymous> (file:///Applications/Wappler.app/Contents/Resources/app/Shared/DMXzone/dmxAppCreator/UI/databaseManager.js:8:45179) at HTMLButtonElement.dispatch (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5430:27) at HTMLButtonElement.elemData.handle (/Applications/Wappler.app/Contents/Resources/app/node_modules/jquery/dist/jquery.js:5234:28) at HTMLButtonElement.sentryWrapped (/Applications/Wappler.app/Contents/Resources/app/node_modules/@sentry/browser/dist/helpers.js:75:23)
How do you change environment ? Environment is usually per process, so it works only the in process you change it. Or if it is global then it will be applied only when a new process is started (so Wappler restart indeed)
I am pretty sure I just do something fundementally wrong, guessing my way
But it looks like that edting the database options per Target required a new start of Wappler. After I added all database settings (tried a couple of times now) and quit Wappler after each editing, they are stored now.
When I change the Target on the Publish Dialog, it seems to write the correct database settings into /app/modules/connections/...json
Is this actually the correct process to set it up?
I might know what the problem is.
When you open the database connection settings in “Workflows->Globals->DB Connections->dbconnection1”, you actually open the tab with settings only for this specific target.
So if you want to set different settings for another Target, you should close the tab first.
Because the opened tab will not be refreshed automatically when you change the current Target in the bottom panel.
It will look like you are seeing settings for current Target, but actually it would be for previous.
Keep it in this thread, but what’s this message about, @George?
Ignoring invalid configuration option passed to Connection: supportBigNumber. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection
Is displayed in the console with every database request