SQL Helper is an advanced Visual Studio Code extension that accelerates database development by providing:
- 70+ professional snippets for SQL, Java JDBC, Python, and JavaScript/TypeScript
- Smart SQL Analyzer that detects errors in any language
- SQL Formatter for automatic readability improvement
Generate production-ready code in seconds β from complex SQL queries to full CRUD methods with transactions and error handling.
- Selection: Basic SELECT, WHERE, LIMIT, OFFSET, ORDER BY, GROUP BY, DISTINCT, JOINs
- Manipulation: INSERT (single & multiple), UPDATE, DELETE
- Structure: CREATE TABLE (con tipos de datos avanzados), IF NOT EXISTS, Foreign Keys
- DDL: ALTER TABLE (ADD/DROP/MODIFY columns), CREATE INDEX, DROP TABLE
- Advanced Queries: JOINs (LEFT, RIGHT, INNER), UNION, CASE WHEN, Subqueries
- Functions: String (CONCAT, SUBSTRING, UPPER/LOWER, REPLACE), Dates (NOW, DATE_ADD, DATEDIFF)
- BD: Views, Triggers, Stored Procedures
- Utility: file generator, backup/restore
- JDBC connection with connection pool
- SELECT with List, SELECT by ID, SELECT with conditions
- INSERT, UPDATE, DELETE using PreparedStatement
- COUNT, full transactions
- Exception handling and try-with-resources
- SQLite, MySQL (mysql-connector), PostgreSQL connections
- SELECT (fetchall, fetchone), INSERT (single & multiple)
- UPDATE, DELETE with affected rows
- Transactions with commit/rollback
- Context managers, SQLAlchemy ORM
- MySQL (mysql2/promise), PostgreSQL (pg) connections
- SELECT, INSERT, UPDATE, DELETE with async/await
- Reusable methods, COUNT
- Runtime CREATE TABLE
- Transactions with rollback
- ORM integration (Sequelize)
Detects 8+ error types:
- Missing semicolon (;)
- Unbalanced quotes (', ")
- Unbalanced parentheses
- SELECT without FROM
- INSERT without VALUES
- UPDATE/DELETE WITHOUT WHERE (dangerous)
β οΈ - Reserved keywords used as identifiers
Supports multiple languages:
.sqlβ Raw SQL.javaβ Strings:"SELECT * FROM...".js/.tsβ Template literals: const sql =SELECT....pyβ Strings:sql = "SELECT..."
Displays errors in:
- Problems Panel (native VS Code integration)
- Interactive QuickPick (select for details)
- Output Channel (detailed logs)
- Automatically reformats SQL
- Adds line breaks to keywords (SELECT, FROM, WHERE, JOIN...)
- Cleans excessive whitespace
- Works in all supported languages
- Automatic language detection
- Smart search with descriptions
- Emoji-based categorization (π SELECT, βοΈ CRUD, ποΈ DDLβ¦)
- Full logging with timestamps
- Robust error reporting
- Customizable keybindings (Ctrl+Alt+S/A/F/J)
- Open VS Code
- Go to Extensions (
Ctrl+Shift+X) - Search for SQL Helper
- Click Install or visit:
π SQL Helper on Visual Studio Marketplace
Install SQL Helper
npm install
npm run compile
vsce package
code --install-extension sql-helper-*.vsix| Command | Shortcut | Description |
|---|---|---|
| Insert Snippet | Ctrl+Alt+S |
Opens snippet menu |
| Analyze SQL | Ctrl+Alt+A |
Detects SQL issues |
| Format SQL | Ctrl+Alt+F |
Reformats query |
| Generate Python Project | Ctrl+Alt+P |
Create Flask/FastAPI project |
| Generate JavaScript/TypeScript Project | Ctrl+Alt+J |
Create Express/Nest/Next project |
macOS: Replace
CtrlwithCmd
1. Open a .sql, .java, .py, .js or .ts file
2. Press Ctrl+Alt+S
3. Type to search (e.g. "SELECT", "INSERT")
4. Press Enter
5. Code is inserted automatically
1. Open a file containing SQL
2. Press Ctrl+Alt+A
3. Errors appear in:
- Problems Panel
- QuickPick
4. Select an error for details
1. Select SQL query (or whole file)
2. Press Ctrl+Alt+F
3. Query is formatted automatically
1. Press Ctrl+Alt+P
2. Choose framework (Flask or FastAPI)
3. Select Python version (3.10, 3.11, 3.12)
4. Choose database (PostgreSQL, MySQL, SQLite)
5. Select folder
6. Project folder with virtualenv, DB module, models, CRUD, and README is generated
1. Press Ctrl+Alt+J
2. Choose framework:
- Express.js: Minimalist Node.js backend
- NestJS: Full-featured TypeScript backend
- Next.js: React-based frontend + backend
3. Select project folder
4. Full project scaffolding is generated:
- Folder structure
- package.json with dependencies
- Starter files (index.js, main.ts, app.module.ts, pages/index.js)
βοΈ File: queries.sql
π Content:
UPDATE users SET name = 'John'
β Missing WHERE clause
β¨οΈ Press: Ctrl+Alt+A
π― Result:
β UPDATE/DELETE SIN WHERE
Detected: "Line 1 - UPDATE without WHERE"
π‘ Suggestion: Add WHERE to avoid updating all records// queries.java
String sql = "INSERT INTO users (name) VALUES ('John')" // β Missing ;
β¨οΈ Press: Ctrl+Alt+A
π― Result:
β MISSING SEMICOLON
Detected: "Line 1"
π‘ Suggestion: "Add ; at the end of the SQL statement"βοΈ Original content:
SELECT a.id,a.name,b.email FROM users a INNER JOIN profiles b ON a.id=b.user_id WHERE a.status='active' ORDER BY a.created_at DESC LIMIT 10
β¨οΈ Press: Ctrl+Alt+F
π― Result:
SELECT a.id, a.name, b.email
FROM users a
INNER JOIN profiles b ON a.id = b.user_id
WHERE a.status = 'active'
ORDER BY a.created_at DESC
LIMIT 10def transfer_money(from_id, to_id, amount):
conn = mysql.connector.connect(**config)
cursor = conn.cursor()
try:
cursor.execute("UPDATE accounts SET balance = balance - %s WHERE id = %s",
(amount, from_id))
cursor.execute("UPDATE accounts SET balance = balance + %s WHERE id = %s",
(amount, to_id))
conn.commit()
except Exception as e:
conn.rollback()
raise e
finally:
cursor.close()
conn.close()public static void insertUser(User user) throws SQLException {
String sql = "INSERT INTO users (name, email) VALUES (?, ?)";
try (Connection conn = DatabaseConnection.getConnection();
PreparedStatement ps = conn.prepareStatement(sql)) {
ps.setString(1, user.getName());
ps.setString(2, user.getEmail());
ps.executeUpdate();
}
}async function getUserById(userId) {
try {
const [rows] = await pool.query(
"SELECT * FROM users WHERE id = ?",
[userId]
);
return rows[0] || null;
} catch (error) {
console.error("Database error:", error);
throw error;
}
}- VS Code:
^1.106.0 - Node.js:
14+(for development)
- β Added Python project generation (Flask/FastAPI) with DB modules and CRUD
- β Added JavaScript/TypeScript project generation (Express/Nest/Next.js)
- β
Updated keybindings (
Ctrl+Alt+P,Ctrl+Alt+J) - β Improved README with usage examples
- β Refactored code into modular structure
- β Improved logging via Output Channel
- β 40+ SQL snippets added
- β 9+ Java JDBC methods
- β 15+ Python snippets
- β 15+ JavaScript/TypeScript snippets
- β Customizable keybindings (Ctrl+Alt+S/A/F)
- β Enhanced error handling
- β SQL Analyzer added
- β SQL Formatter added
- Initial release with basic SQL snippets
- Basic keybindings for insert snippet
- Fork the repo
- Create a branch (
git checkout -b feature/AmazingFeature) - Commit your changes
- Push the branch
- Open a Pull Request
Report bugs or request features here: GitHub Issues
MIT β Free for commercial and personal use