vscode-database
vscode-database copied to clipboard
Can't create new connection
I click on the "Server not selected". I choose new connection. I select PostgreSQL. It isn't on localhost. When I paste in the URI, it already filled it out and is asking for the database.
I created a default for my localhost, but couldn't get that to work either. Is there a way to edit a connection?
Is there a way I can get a form or add a database connection manually?
I don't think you can use a URI as the host, it's expecting domain or domain:port, like example.org or example.org:5432. Once you create a connection and connect successfully, you can then run the SQL: Save current server command to save it.
Here is an example of the Workspace Settings file without any settings besides the vscode-database. Options for the type settings are mysql or postgres. This will set up a connection manually.
{
"database.connections": [
{
"type": "postgres",
"name": "your config name",
"user": "your-db-user",
"host": "example.com:5432",
"password": "your-db-password",
"database": "your_database"
}
]
}
EDIT: Correction, these settings live in the Workspace Settings, not the User Settings. You may need to reload the window to get them to show up.
Thanks for the reply. I was able to create an mysql connection, but it does seem to save between sessions,
I have successfully connected to mysql and using the setting above I was able to save the connection. It automatically connects whenever I open VSCode.
Hello I have the same problem above. After setting up, it displays errors. Please I am totally new to using VS Code and have already installed required PHP extensions and vscode-database on it. What next step should I take to completely set up the connection database to MySQL. NB: I have also Xampp installed on my machine. Your help is really appreciated.
Looks like the real problem is the form that doesn't shows up so you could set the server info. I hard set it two at the JSON file and it got connected after I restart it.