SQL Insert Hover
A VS Code extension that shows corresponding values when hovering over column names in INSERT SQL statements.
Features
- Hover to see values: Move your mouse over any column name in an INSERT statement to see all corresponding values
- Multi-row support: Works with INSERT statements containing multiple VALUES rows
- String handling: Properly handles quoted strings with escape characters
- File support: Works with
.sql files and .txt (plaintext) files
Example
Given the following SQL:
INSERT INTO users (id, name, email, age) VALUES
(1, 'John Doe', 'john@example.com', 30),
(2, 'Jane Smith', 'jane@example.com', 25),
(3, 'Bob Wilson', 'bob@example.com', 35);
When you hover over the name column, you'll see:
Column: name
Table: users
Values:
| Row | Value |
|-----|------------|
| 1 | John Doe |
| 2 | Jane Smith |
| 3 | Bob Wilson |
Installation
- Clone or download this repository
- Open the folder in VS Code
- Press
F5 to run the extension in a new Extension Development Host window
Or package it:
npm install
npm run compile
vsce package
Then install the .vsix file in VS Code.
Requirements
Supported SQL Syntax
The extension supports standard INSERT INTO syntax:
-- Single row
INSERT INTO table (col1, col2) VALUES (val1, val2);
-- Multiple rows
INSERT INTO table (col1, col2) VALUES
(val1, val2),
(val3, val4),
(val5, val6);
-- With quoted strings
INSERT INTO table (name, description) VALUES
('John', 'A person\'s name'),
('Jane', "Another \"quoted\" value");
Extension Settings
This extension currently has no configurable settings.
Known Issues
- Complex nested expressions in VALUES may not be parsed correctly
- The extension only works with INSERT statements, not UPDATE or other SQL commands
Release Notes
1.0.0
- Initial release
- Support for INSERT INTO ... VALUES ... syntax
- Multi-row VALUES support
- String quote and escape character handling
Contributing
Feel free to submit issues and pull requests on the project repository.
License
MIT