codemirror-sql
by marimo
A CodeMirror extension for SQL with real-time syntax validation and error diagnostics using node-sql-parser.
SQL Editor with Diagnostics
Try typing invalid SQL syntax to see real-time error highlighting and messages. Valid tables are: users, posts, orders, customers, categories
Example Queries
Click any example to load it into the editor:
Valid Queries
Invalid Queries (will show errors)
Features
Real-time Validation
SQL syntax is validated as you type with a configurable delay (750ms default).
Error Highlighting
Syntax errors are highlighted with red underlines and detailed error messages.
Multiple SQL Dialects
Supports MySQL, PostgreSQL, MariaDB, and SQLite syntax validation.
TypeScript Support
Full TypeScript support with comprehensive type definitions.