Closed cknott closed 3 months ago
system
might return a new line at the end. Try logging and see what's the output.
Awesome, thank you for the quick reply. The newline was indeed the cause of the error. I know use vim.fn.systemlist instead:
local url = "mysql://root:root@127.0.0.1:" .. vim.fn.systemlist("ddev st -j | jq '.raw.services.db.host_ports|tonumber'")[1]
I'm trying to use a dynamic, per project database url in the configuration, but somehow the connection fails, even though when printing the resulting url and trying to connect to it, the connection is established. Heres my approach:
The connection named 'ddevtest' is the same connection as the one from the below. Only difference is that i get the connection from below dynamically by calling the ddev status command and parsing the resulting json to get the exposed port.
Any idea what could be wrong here?
Thanks!