Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

All notable changes to Simple DB are documented in this file.

## 0.1.4 - 2026-08-08

### Added

- A focused **Simple DB** SQL-editor submenu with **Select / Change Connection...**, **Run Statement**, **Run Script**, **Go to Definition**, and **Go to Declaration**.
- **Create New Connection...** inside the SQL-file connection picker, including the first-`Ctrl+Enter` flow when no profiles exist yet.
- Alias/column navigation such as `c.nombre -> clientes.nombre`.
- Overload-aware navigation. PostgreSQL routine metadata now includes argument/default counts, and Oracle package member navigation distinguishes compatible package members from the call arguments when possible.
- Synonym following for resolvable Oracle and SQL Server targets, with private Oracle synonyms preferred over public synonyms.
- Chained navigation from read-only database source/DDL documents while preserving the originating connection, database, and schema.
- Explicit source/metadata permission messages when an object exists but its source/DDL cannot be read.
- A real SQLite navigation integration test and an opt-in `npm run test:live-navigation` smoke test for real PostgreSQL, MySQL, SQL Server, and Oracle profiles.

### Changed

- Oracle package **Go to Declaration** targets the package specification; **Go to Definition** targets the matching package-body implementation.
- Ambiguous overloads return all valid navigation locations instead of silently choosing the first catalog row.
- `Ctrl+Enter` is **Run Statement**, `F5` is **Run Script**, and `F12` invokes Simple DB definition navigation in SQL editors.
- Context-only administrative/object commands are hidden from the Command Palette so the primary SQL workflow is easier to discover.

## 0.1.3 - 2026-08-08

### Added
Expand Down
34 changes: 20 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Simple DB

Simple DB `0.1.3` is a Visual Studio Code extension written entirely in JavaScript for working with **SQLite, PostgreSQL, MySQL, SQL Server, and Oracle** through a single interface.
Simple DB `0.1.4` is a Visual Studio Code extension written entirely in JavaScript for working with **SQLite, PostgreSQL, MySQL, SQL Server, and Oracle** through a single interface.

The extension opens regular VS Code SQL documents. `F5` launches `src/extension.js` directly: there is no TypeScript, `tsconfig.json`, `dist` folder, or compilation step.
The extension opens regular VS Code SQL documents and loads `src/extension.js` directly: there is no TypeScript, `tsconfig.json`, `dist` folder, or compilation step.

## Main features

Expand All @@ -20,16 +20,17 @@ The extension opens regular VS Code SQL documents. `F5` launches `src/extension.
- View results below the SQL editor in a resizable SQL Developer-style grid with row numbers, multiple result sets, types, `NULL`, affected rows, duration, and cell/row/selection copy actions.
- Preserve 64-bit integers and high-precision `NUMBER` values exactly before displaying or exporting them.
- Export already-retrieved results to CSV, JSON, or XLSX without executing the SQL again.
- Use native **Go to Definition** / **Go to Declaration** navigation for database objects whose source or DDL is exposed by the connected engine, including routines and Oracle packages.
- Use **Go to Definition** / **Go to Declaration** for tables, views, routines, packages, triggers, types, sequences, indexes, synonyms, and other source/DDL-backed objects supported by each engine.
- Navigate through table aliases/columns, PostgreSQL and Oracle overloads, Oracle package specifications/bodies, and synonym targets without losing the SQL file's connection context.

## Quick start

1. Open **Simple DB** in the Activity Bar and choose **Create Connection**.
2. Select the database engine and enter a connection name. SQLite uses the native file picker; network databases create a JSON profile with the correct default parameters.
3. Edit the generated JSON if needed, press `Ctrl+S`, then use **Test Connection** or **Connect** from the connection menu. Passwords stay outside JSON in VS Code `SecretStorage`.
4. Open or create any `.sql` file. Click the database icon or **Simple DB: Select Connection** in the status bar and choose the connection this file should use. If you press `Ctrl+Enter` before choosing, Simple DB asks you once and attaches the selected connection automatically.
5. Press `Ctrl+Enter` (**Execute Query**) to run the selection or statement at the cursor. Use `Ctrl+Shift+Enter` (**Execute Script**) for the entire document. Saved SQL files keep their selected connection when closed and reopened.
6. Results appear automatically in the resizable **Simple DB — Results** panel below the SQL editor. `F12` / **Go to Definition** and **Go to Declaration** use the same attached connection to resolve database objects.
4. Open or create any `.sql` file. Click the database icon or **Simple DB: Select Connection** in the status bar and choose the connection this file should use. The picker also offers **Create New Connection...**. If you press `Ctrl+Enter` before choosing, Simple DB opens the same picker and then attaches the selected connection automatically.
5. Press `Ctrl+Enter` (**Run Statement**) to run the selection or statement at the cursor. Press `F5` (**Run Script**) for the entire document. Saved SQL files keep their selected connection when closed and reopened.
6. Results appear automatically in the resizable **Simple DB — Results** panel below the SQL editor. `F12` / **Go to Definition** opens the implementation/source; **Go to Declaration** opens the declaration when the engine exposes a separate one.

## Five database engines

Expand All @@ -41,7 +42,7 @@ The extension opens regular VS Code SQL documents. `F5` launches `src/extension.
| SQL Server | `mssql` | databases, schemas, tables, views, procedures/functions, indexes, triggers, sequences, types, synonyms, `GO` |
| Oracle | `oracledb` Thin | schemas, tables, views/materialized views, procedures/functions, packages, indexes, triggers, sequences, types, synonyms, PL/SQL |

Oracle uses the default `node-oracledb` Thin mode, so normal connections do not require Oracle Client to be installed. Simple DB `0.1.3` uses SQL authentication with a username and password for SQL Server.
Oracle uses the default `node-oracledb` Thin mode, so normal connections do not require Oracle Client to be installed. Simple DB `0.1.4` uses SQL authentication with a username and password for SQL Server.

## No imposed row limit by default

Expand Down Expand Up @@ -144,13 +145,15 @@ The `id` is generated and managed by Simple DB. Do not change it. Use **Simple D

Right-clicking inside an editor now shows a native **Simple DB** submenu with the main actions:

- Create Connection
- New Query
- Select Connection for SQL File
- Execute Query
- Execute Script
- Select / Change Connection...
- Run Statement (`Ctrl+Enter`)
- Run Script (`F5`)
- Go to Definition (`F12`)
- Go to Declaration

VS Code's native **Go to Definition** and **Go to Declaration** actions are available in SQL editors. Simple DB resolves them against the connection attached to that file and opens the database-provided source/DDL in a read-only virtual SQL document.
The lower-right status bar shows the profile currently attached to the SQL file. **Select / Change Connection...** marks that profile in the picker and lets the file switch to another one. If there are no profiles yet, **Create New Connection...** is available directly in the picker.

Navigation resolves against the connection attached to the SQL file and opens database-provided source/DDL in a read-only virtual SQL document. Oracle package **Go to Declaration** targets the package specification while **Go to Definition** targets the package body. When an overload can be identified from the call arguments, Simple DB selects it; when several overloads remain valid, it presents all valid locations instead of guessing. `alias.column` references are resolved back to their underlying table/view column, Oracle and SQL Server synonyms are followed to the target object when it is local/resolvable, and navigation can continue from one opened database definition into another. If catalog/source permissions are insufficient, Simple DB reports that explicitly.

### SQLite note

Expand Down Expand Up @@ -191,12 +194,15 @@ Project commands:
|---|---|
| `npm run lint` | Run ESLint on JavaScript sources |
| `npm test` | Run JavaScript Vitest tests |
| `npm run test:live-navigation` | Run read-only metadata/source smoke checks against real server profiles plus a temporary real SQLite database |
| `npm run check` | Run lint + tests |
| `npm run package` | Validate and build the VSIX |
| `npm run package:win32` | Build a `win32-x64` VSIX |
| `npm run package:linux` | Build a `linux-x64` VSIX |

The test suite covers parsing, safety rules, DDL, storage, mocked `SecretStorage`, and a real SQLite integration. External PostgreSQL, MySQL, SQL Server, and Oracle servers require their own credentials/infrastructure for integration testing against live instances.
The normal test suite covers parsing, safety rules, DDL, storage, mocked `SecretStorage`, advanced SQL navigation, and a real SQLite integration. External PostgreSQL, MySQL, SQL Server, and Oracle servers require their own credentials/infrastructure for live verification.

`npm run test:live-navigation` intentionally does not use mocks. Before running all five engines, define JSON profiles in `SIMPLE_DB_LIVE_POSTGRESQL_PROFILE`, `SIMPLE_DB_LIVE_MYSQL_PROFILE`, `SIMPLE_DB_LIVE_SQLSERVER_PROFILE`, and `SIMPLE_DB_LIVE_ORACLE_PROFILE`, with the matching passwords in `SIMPLE_DB_LIVE_<ENGINE>_PASSWORD`. An optional `navigationTestSchema` property selects the schema to inspect. `SIMPLE_DB_LIVE_ENGINES=sqlite` can be used to run only the self-contained SQLite live check. The live check only reads catalogs/source on the server engines; its SQLite database is created in a temporary directory.

## Project structure

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

126 changes: 109 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "simple-db-suzdalenko",
"displayName": "Simple DB - SQL Client for SQLite, MySQL, PostgreSQL, SQL Server & Oracle",
"description": "SQL client and database editor for SQLite, MySQL, PostgreSQL, SQL Server (MSSQL) and Oracle. Browse database objects, run queries, manage DDL and export results.",
"version": "0.1.3",
"version": "0.1.4",
"publisher": "suzdalenko-dev",
"license": "MIT",
"icon": "resources/simple-db-marketplace.png",
Expand Down Expand Up @@ -123,13 +123,13 @@
},
{
"command": "simpleDb.changeEditorConnection",
"title": "Select Connection for SQL File",
"title": "Select / Change Connection...",
"category": "Simple DB",
"icon": "$(database)"
},
{
"command": "simpleDb.executeCurrent",
"title": "Execute Query",
"title": "Run Statement",
"category": "Simple DB",
"icon": "$(play)"
},
Expand All @@ -140,10 +140,20 @@
},
{
"command": "simpleDb.executeDocument",
"title": "Execute Script",
"title": "Run Script",
"category": "Simple DB",
"icon": "$(run-all)"
},
{
"command": "simpleDb.goToDefinition",
"title": "Go to Definition",
"category": "Simple DB"
},
{
"command": "simpleDb.goToDeclaration",
"title": "Go to Declaration",
"category": "Simple DB"
},
{
"command": "simpleDb.cancelQuery",
"title": "Cancel Query",
Expand Down Expand Up @@ -242,6 +252,80 @@
]
},
"menus": {
"commandPalette": [
{
"command": "simpleDb.refreshConnections",
"when": "false"
},
{
"command": "simpleDb.connect",
"when": "false"
},
{
"command": "simpleDb.disconnect",
"when": "false"
},
{
"command": "simpleDb.testConnection",
"when": "false"
},
{
"command": "simpleDb.editConnection",
"when": "false"
},
{
"command": "simpleDb.setPassword",
"when": "false"
},
{
"command": "simpleDb.openConnectionsFolder",
"when": "false"
},
{
"command": "simpleDb.deleteConnection",
"when": "false"
},
{
"command": "simpleDb.executeSelection",
"when": "false"
},
{
"command": "simpleDb.beginTransaction",
"when": "false"
},
{
"command": "simpleDb.commit",
"when": "false"
},
{
"command": "simpleDb.rollback",
"when": "false"
},
{
"command": "simpleDb.selectTable",
"when": "false"
},
{
"command": "simpleDb.showDefinition",
"when": "false"
},
{
"command": "simpleDb.createObject",
"when": "false"
},
{
"command": "simpleDb.alterObject",
"when": "false"
},
{
"command": "simpleDb.dropObjectScript",
"when": "false"
},
{
"command": "simpleDb.copyQualifiedName",
"when": "false"
}
],
"view/title": [
{
"command": "simpleDb.addConnection",
Expand Down Expand Up @@ -361,33 +445,35 @@
"editor/context": [
{
"submenu": "simpleDb.editorContextMenu",
"when": "editorLangId == sql && resourceScheme != simple-db-definition",
"when": "editorLangId == sql",
"group": "simpleDb@1"
}
],
"simpleDb.editorContextMenu": [
{
"command": "simpleDb.addConnection",
"command": "simpleDb.changeEditorConnection",
"when": "editorLangId == sql && resourceScheme != simple-db-definition",
"group": "1_connection@1"
},
{
"command": "simpleDb.newQuery",
"group": "1_connection@2"
"command": "simpleDb.executeCurrent",
"when": "editorLangId == sql && resourceScheme != simple-db-definition",
"group": "2_run@1"
},
{
"command": "simpleDb.changeEditorConnection",
"when": "editorLangId == sql",
"group": "2_query@1"
"command": "simpleDb.executeDocument",
"when": "editorLangId == sql && resourceScheme != simple-db-definition",
"group": "2_run@2"
},
{
"command": "simpleDb.executeCurrent",
"command": "simpleDb.goToDefinition",
"when": "editorLangId == sql",
"group": "2_query@2"
"group": "3_navigation@1"
},
{
"command": "simpleDb.executeDocument",
"command": "simpleDb.goToDeclaration",
"when": "editorLangId == sql",
"group": "2_query@3"
"group": "3_navigation@2"
}
]
},
Expand All @@ -400,9 +486,14 @@
},
{
"command": "simpleDb.executeDocument",
"key": "ctrl+shift+enter",
"mac": "cmd+shift+enter",
"key": "f5",
"mac": "f5",
"when": "editorTextFocus && editorLangId == sql && resourceScheme != simple-db-definition"
},
{
"command": "simpleDb.goToDefinition",
"key": "f12",
"when": "editorTextFocus && editorLangId == sql"
}
],
"configuration": {
Expand Down Expand Up @@ -456,6 +547,7 @@
"vscode:prepublish": "npm run check",
"lint": "eslint src",
"test": "vitest run --globals",
"test:live-navigation": "node src/test/liveNavigation.live.js",
"check": "npm run lint && npm run test",
"package": "npm run check && vsce package",
"package:win32": "npm run check && vsce package --target win32-x64",
Expand Down
6 changes: 4 additions & 2 deletions src/adapters/oracleAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ class OracleAdapter extends BaseAdapter {
async listSynonyms(_database, schema) {
return this._query(
`SELECT synonym_name AS "name",
table_owner || '.' || table_name AS "target"
table_owner || '.' || table_name AS "target",
owner AS "owner",
db_link AS "dbLink"
FROM all_synonyms
WHERE owner = :owner
WHERE owner IN (:owner, 'PUBLIC')
ORDER BY synonym_name`,
{ owner: schema },
);
Expand Down
4 changes: 3 additions & 1 deletion src/adapters/postgresqlAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,9 @@ class PostgreSqlAdapter extends BaseAdapter {
database,
`SELECT p.proname AS name,
CASE p.prokind WHEN 'p' THEN 'PROCEDURE' ELSE 'FUNCTION' END AS type,
pg_get_function_identity_arguments(p.oid) AS signature
pg_get_function_identity_arguments(p.oid) AS signature,
p.pronargs AS "argumentCount",
p.pronargdefaults AS "defaultArgumentCount"
FROM pg_proc p
JOIN pg_namespace n ON n.oid = p.pronamespace
WHERE n.nspname = $1 AND p.prokind IN ('f', 'p')
Expand Down
8 changes: 8 additions & 0 deletions src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ async function activate(context) {
vscode.window.showInformationMessage(
`Simple DB: "${saved.name}" created. Edit the JSON, press Ctrl+S, then test or connect.`,
);
return saved;
});

registerCommand(context, 'simpleDb.refreshConnections', async () => {
Expand Down Expand Up @@ -341,6 +342,13 @@ async function activate(context) {
editorSessionManager.changeActiveConnection(),
);

registerCommand(context, 'simpleDb.goToDefinition', () =>
sqlNavigationProvider.openFromActiveEditor('definition'),
);
registerCommand(context, 'simpleDb.goToDeclaration', () =>
sqlNavigationProvider.openFromActiveEditor('declaration'),
);

registerCommand(context, 'simpleDb.executeCurrent', () => queryRunner.run('current'));
registerCommand(context, 'simpleDb.executeSelection', () =>
queryRunner.run('selection'),
Expand Down
Loading
Loading