VS Code Extension¶
l0l1 provides a VS Code extension for SQL validation, PII detection, and AI-powered completions directly in your editor.
Installation¶
Prerequisites¶
- VS Code 1.80.0 or higher
- l0l1 API server running
Install from VSIX¶
Then in VS Code: Extensions: Install from VSIX...
Quick Start¶
-
Start the l0l1 server:
-
Open a
.sqlfile in VS Code -
The extension activates automatically and validates your SQL
Features¶
Real-time Validation¶
SQL files are validated on save. Issues appear in: - Problems panel - Editor squiggles - Status bar
PII Detection¶
Automatically detects sensitive data: - Email addresses - Phone numbers - SSNs, credit cards - IP addresses
AI Explanations¶
Select SQL and run l0l1: Explain SQL Query (Ctrl+Shift+E) to get:
- Plain English explanation
- Complexity assessment
- Tables accessed
Smart Completions¶
AI-powered suggestions based on: - Your schema context - Previously successful queries - SQL best practices
Commands¶
| Command | Shortcut | Description |
|---|---|---|
| Validate Document | Ctrl+Shift+V |
Validate current file |
| Explain Query | Ctrl+Shift+E |
AI explanation |
| Check for PII | Ctrl+Shift+P |
Detect PII |
| Anonymize PII | - | Replace PII with placeholders |
| Set Schema | - | Select schema file |
Configuration¶
{
"l0l1.enable": true,
"l0l1.serverMode": "api",
"l0l1.apiUrl": "http://localhost:8000",
"l0l1.workspace": "vscode",
"l0l1.validateOnSave": true,
"l0l1.validateOnType": false,
"l0l1.enablePiiDetection": true,
"l0l1.schemaFile": "./schema.sql"
}
Server Modes¶
API Mode (default) - Connect to REST API:
TCP Mode - Connect to LSP server:
Start LSP server:
Embedded Mode - Auto-start LSP:
Schema Context¶
For better validation, set a schema file:
- Run
l0l1: Set Schema Context - Select your schema SQL file
- Validation now considers your tables/columns
Troubleshooting¶
Extension not working¶
-
Check l0l1 server is running:
-
Check VS Code output panel (l0l1 SQL)
-
Verify settings in VS Code
No diagnostics appearing¶
- Ensure file is
.sqlextension - Check
l0l1.enableistrue - Try
l0l1: Restart Server
Development¶
See the vscode-extension README for development instructions.