SQL Client
SQL Client is a multi-database SQL workspace for Visual Studio Code. Create saved connections for Oracle, MySQL/MariaDB, and SQLite; browse database objects; run SQL in dedicated consoles; and review, sort, search, copy, and export results without leaving VS Code.
Requirements
- VS Code 1.85 or later
- Network access and database credentials for server connections
The extension uses the VS Code SecretStorage service for passwords and runs on the local machine. File-based settings such as SQLite databases, SSH keys, TLS certificates, and Oracle wallets must refer to paths that exist on the machine where VS Code is running.
Supported databases
| Database |
Connection options |
| Oracle Database |
Direct connection, Service Name or SID, Oracle Thin mode, optional SSH tunnel |
| MySQL / MariaDB |
Direct connection, optional SSH tunnel |
| SQLite |
Local database file, opened read-only |
New server connections default to port 1521 for Oracle and 3306 for MySQL/MariaDB. Switching the database type updates an untouched default port automatically.
Getting started
- Open the SQL Client activity-bar view.
- Select Add Connection.
- Enter a connection name, database type, server details, and credentials. For Oracle, choose either Service Name or SID.
- Optionally select Use SSH tunnel and complete the bastion-host details.
- Select Test Connection to validate the current values without saving them.
- Save the connection, then use its context menu to Connect or Open Query Console.
Opening a console for a disconnected saved connection attempts to connect it first. If connecting fails, the console does not open and the error is shown in VS Code.
Connection management
- Add, edit, duplicate, and delete saved connections.
- Right-click Edit Connection to open that specific connection immediately; the Command Palette action still lets you choose a connection.
- Keep multiple connections active at once.
- See compact database badges in the Connections view: O for Oracle, M for MySQL/MariaDB, and S for SQLite.
- Sort connections by Most Recently Used, Alphabetical, or Connection Type. Type ordering adds visible group separators.
- Refresh, connect, disconnect, and open a console from a connection’s context menu.
Connection metadata is saved in VS Code extension storage. Database passwords, SSH passwords, and SSH key passphrases are saved separately in VS Code SecretStorage and are never written to connection profiles.
SSH tunnels
SSH tunnels are available for Oracle and MySQL/MariaDB connections. Enable Use SSH tunnel in Add or Edit Connection and enter:
- SSH hostname, port, and username
- Password authentication, or key-pair authentication
- A private-key path, either typed directly or selected with Browse
- An optional private-key passphrase
- An optional SHA-256 SSH host-key fingerprint
The private-key picker accepts any local file name or extension. A directly entered private-key path is checked before saving or testing; if it does not exist, the field is cleared and the form explains the error.
When a host-key fingerprint is supplied, it pins the SSH server identity. Leaving it blank permits the connection but does not provide host-key pinning; only do this when the host is trusted through another channel. The tunnel is bound to the local loopback interface and is closed when its database connection is disconnected.
Database explorer
After connecting, expand the connection to browse schemas and core object types:
- Tables and columns
- Views
- Functions and procedures where supported by the database
- Triggers
Use the object or connection context menus to refresh metadata, reconnect, and open a query console.
Query consoles
Each console is associated with one connection and offers:
- SQL input with lightweight syntax highlighting and a native text-input fallback
- Schema selection with searchable suggestions; up to 30 suggestions are displayed at once while searches use the full loaded schema list
- Execution of the selected/current SQL through the console actions
- Saved console sessions that can be reopened, renamed, or deleted from the connection tree
- Automatic reconnect checks before opening, reopening, or executing from a console; SQL is deliberately not retried automatically after a reconnect
In the console, Cmd+Enter on macOS or Ctrl+Enter on Windows/Linux runs a query. Cmd/Ctrl+F focuses result search. Press Escape to cancel an active query.
Results
Query results open in tabs and support:
- Pagination for large result sets
- Pinning tabs so later executions do not replace them
- Closing tabs with the close icon or a middle mouse click
- Refreshing a tab to rerun its original query
- Sorting each column ascending, descending, or back to the original order
- Searching both column names and row values, with matching headers and cells highlighted
- Selecting rows from the leading checkbox visibly highlights them; select multiple rows and copy with Cmd/Ctrl+C as JSON objects keyed by column names
- Selecting an individual cell and copying its value with Cmd/Ctrl+C; cell and row selections are mutually exclusive
- Exporting the visible, filtered rows of the active tab as CSV or JSON, with a choice to copy to the clipboard or save a file
Security and reliability
- Passwords and SSH passphrases use VS Code SecretStorage rather than profile storage.
- The Query Console and connection form validate messages received from webviews and apply restrictive content security policies.
- Query and connection operations use configurable timeouts.
- SQLite connections reject write and DDL statements in the driver, so SQLite access is read-only.
- SSH tunnels are cleaned up when a connection ends; temporary resources created by Test Connection are also cleaned up without saving the profile or credentials.
Settings
Configure SQL Client from VS Code Settings:
| Setting |
Default |
Purpose |
sqlClient.query.maxRows |
1000 |
Maximum rows fetched by a query |
sqlClient.query.timeout |
30000 |
Query timeout in milliseconds |
sqlClient.query.fetchSize |
100 |
Driver fetch batch size |
sqlClient.query.autoLimit |
true |
Automatically add a limit to eligible SELECT queries |
sqlClient.editor.fontFamily |
monospace |
Query editor font family |
sqlClient.editor.fontSize |
13 |
Query editor font size |
sqlClient.export.defaultFormat |
csv |
Default export format |
sqlClient.export.csvDelimiter |
, |
CSV delimiter |
sqlClient.export.includeHeaders |
true |
Include CSV headers |
sqlClient.connections.autoConnect |
false |
Automatically connect to the last-used connection at startup |
sqlClient.connections.showInStatusBar |
true |
Show connection state in the status bar |
sqlClient.connections.connectionTimeout |
30000 |
Connection timeout in milliseconds |
sqlClient.connections.sortOrder |
recent |
Connections-view ordering: recent, alphabetical, or type |
Development
npm install
npm test
npm test compiles TypeScript, runs ESLint, and executes the Vitest suite. Automated tests do not replace live database and SSH testing on each supported operating system.
License
Licensed under the MIT License.