Microsoft's PostgreSQL extension for Visual Studio Code (VSCode) allows you to connect to bit.io from VSCode and use it as a SQL client to query your data on bit.io.
First, install the PostgreSQL extension from the Extensions marketplace.
Next, navigate to "SQLTools" in the left sidebar and click "Add new connection."
Select "PostgreSQL" from the next menu. This will prompt you to fill in the connection details for the database to which you're connecting. All of the details you need are available in the bit.io Connect Tab of the database page on bit.io.
There are two different ways you can connect.
First, you can select "Connection String" from the "Connect using*" dropdown. Copy your Connection string from your bit.io database page's connect tab into the "Connection String" field in VSCode, change "SSL" to "Enabled."
Make sure SSL is set to "Enabled" or you will not be able to connect to your bit.io database with VSCode.
Alternately, you can connect using "Server and Port" from the "Connect using" dropdown menu and fill in the connection details individually from the corresponding fields in your database page's Connect Tab. Again, ensure SSL is set to "Enabled" or you will not be able to connect.
Click "TEST CONNECTION." You may be prompted for your password (from the "Password" field of your bit.io database's Connect Tab). You should then receive a "Successfully connected!" message, at which point you can click "SAVE CONNECTION" to keep using the connection in the future.
Once you've created your connection, click on it in the "Connections" pane in the left sidebar. This will open up a
.sql file where you can write and execute queries.
You can also navigate your database's schema, preview tables, and more from the "Connections" pane.
For more details, see the extension's quick-start guide.
Updated 3 months ago