10 Best VS Code Extensions for Databases and SQL

Ten VS Code extensions for working with databases and SQL. SQLTools, SQL Server, PostgreSQL, SQLite, DBCode, and tools for querying, visualizing, and managing data.

8 min read

These 10 extensions let you connect to databases, run queries, explore schemas, and visualize data without leaving VS Code. Whether you use SQL Server, PostgreSQL, MySQL, SQLite, or MongoDB, there is an extension that brings the database directly into your editor.

If you are new to managing extensions, read the guide on how to install, disable, and update extensions.

Universal database clients

1. SQLTools

Publisher: mtxr.sqltools
Why: SQLTools is a universal database client with a driver-based architecture. Install the base extension, then add drivers for your databases.

Supported databases include PostgreSQL, MySQL, SQLite, SQL Server, Redis, and Cassandra. Once connected, you get an explorer view of your tables, views, and stored procedures.

Write queries with autocomplete. Results appear in a table view. You can bookmark frequently used queries and export results to CSV or JSON.

2. DBCode

Publisher: DBCode.dbcode
Why: A modern, polished database client with a focus on user experience. Connects to PostgreSQL, MySQL, MongoDB, SQL Server, and more.

Features include a schema explorer, query editor with IntelliSense, result export, and SSH tunnel support. DBCode is newer than SQLTools but has gained popularity for its clean interface. If you prefer a GUI-style database tool inside VS Code, DBCode is a strong choice.

SQL Server

3. SQL Server (mssql)

Publisher: ms-mssql.mssql
Why: Microsoft's official SQL Server extension. Connect to SQL Server and Azure SQL Database. Write queries with IntelliSense for T-SQL.

View and edit table data. Execute stored procedures. Includes a built-in table designer.

This is the most capable SQL Server tool in VS Code, developed and maintained by Microsoft.

4. SQL Database Projects

Publisher: ms-mssql.sql-database-projects-vscode
Why: Microsoft's extension for SQL database projects. Design your database schema as code, build it into a .dacpac file, and deploy it to SQL Server or Azure SQL.

Useful for teams that manage database schemas in source control.

PostgreSQL

5. PostgreSQL

Publisher: ms-ossdata.vscode-pgsql
Why: Microsoft's official PostgreSQL extension. Connect to PostgreSQL servers and write queries with IntelliSense.

Browse schemas, tables, and views. Supports pg_dump for backups and SSH tunnels for secure connections.

6. PostgreSQL (Database Client)

Publisher: cweijan.vscode-postgresql-client2
Why: An alternative PostgreSQL client from the Database Client publisher. Features include a table editor, data export, and SQL formatting.

The free tier limits you to 3 database connections. A paid Premium license removes that limit and unlocks additional features, priced per year or as a one-time lifetime purchase. Check current pricing at database-client.com before relying on it for more than a few connections.

SQLite

7. SQLite

Publisher: alexcvzz.vscode-sqlite
Why: Query .sqlite and .db files directly without a server. Open any SQLite database file, browse tables, and run queries.

Results appear in a table view. Fast and lightweight for local development and prototyping.

8. SQLite3 Editor

Publisher: yy0931.vscode-sqlite3-editor
Why: A visual SQLite database editor. Browse, search, and edit table data in a spreadsheet-like interface. Export to CSV and SQL.

Supports multiple database files open simultaneously. Good if you prefer editing data in a table view rather than writing SQL for every change.

Schema design and visualization

9. ERD Editor

Publisher: dineug.vuerd-vscode
Why: Design and visualize database schemas with entity-relationship diagrams. Import an existing database to generate a diagram, or design a schema from scratch and export the SQL. Supports PostgreSQL, MySQL, SQLite, SQL Server, and MariaDB.

This is the only tool on this list that is a visual design tool rather than a query client. Use it when planning database changes or documenting existing schemas.

10. MySQL

Publisher: formulahendry.vscode-mysql
Why: A straightforward MySQL client from a well-known publisher. Connect to MySQL and MariaDB servers. Browse databases and tables.

Run queries with basic autocomplete. Lightweight and free with no trial limits.

This extension has had no updates since 2023. For actively maintained MySQL support, use SQLTools with the MySQL driver or DBCode instead.

Quick selection guide

Your databaseBest extension
SQL ServerSQL Server (mssql) by Microsoft
PostgreSQLPostgreSQL by Microsoft or SQLTools + PostgreSQL driver
MySQL / MariaDBMySQL by Jun Han or SQLTools + MySQL driver
SQLite (local files)SQLite or SQLite3 Editor
Multiple databasesSQLTools with drivers or DBCode
Schema designERD Editor

All extensions except PostgreSQL (Database Client) are free. The Database Client extensions have a free tier with paid advanced features. Install from the Extensions view (Ctrl+Shift+X / Cmd+Shift+X).

If you are new to installing extensions, read the guide on how to check whether an extension is safe before installing it before connecting one to a production database.

Rune AI

Rune AI

Key Insights

  • SQLTools (mtxr.sqltools) is the most versatile database client. Install the driver for your database and connect with one click.
  • SQL Server (ms-mssql.mssql) by Microsoft and PostgreSQL (ms-ossdata.vscode-pgsql) by Microsoft offer the deepest integration for those databases.
  • SQLite (alexcvzz.vscode-sqlite) and SQLite3 Editor (yy0931.vscode-sqlite3-editor) let you query .sqlite files directly without a server.
  • DBCode (DBCode.dbcode) provides a polished, modern interface for PostgreSQL, MySQL, MongoDB, and more.
  • ERD Editor (dineug.vuerd-vscode) generates entity-relationship diagrams from your database schema.
RunePowered by Rune AI

Frequently Asked Questions

Can I connect to a production database from VS Code?

Technically yes, but be careful. These extensions let you run any SQL query against the connected database. Always use a read-only user for production connections. Better yet, connect to a development or staging database. Some extensions like SQLTools support marking connections as read-only.

Do these extensions require the database to be installed locally?

No. Most database extensions connect over the network to any accessible database server. You only need the connection details: host, port, database name, username, and password. Some extensions like SQLite work with local files without a server.

What is the difference between SQLTools and DBCode?

SQLTools is an open-source database client with a large driver ecosystem. DBCode is newer and focuses on a polished UI with fewer supported databases. SQLTools has broader database support. DBCode has a more modern interface. Try both and see which feels better for your workflow.

Conclusion

These 10 extensions turn VS Code into a capable database client. Start with SQLTools and install the driver for your database. Add ERD Editor for visual schema design and SQLite or SQLite3 Editor for quick local data inspection. For more database-specific features, Microsoft's SQL Server and PostgreSQL extensions offer the deepest integration. For web developer extensions, see the list of 20 web developer extensions.