QoreDB LogoQoreDB

Editor & autocomplete

The QoreDB editor for SQL and MongoDB. Built on CodeMirror with schema-aware autocomplete, snippets, and a JSON-aware Mongo linter.

QoreDB has two editors, one for SQL drivers (Postgres, MySQL, SQL Server, SQLite, CockroachDB, DuckDB) and one for MongoDB. Both are built on CodeMirror 6 and share the same look and core feel; the language support and the autocomplete sources are what differ.

The SQL editor

When you open a query tab against a SQL connection, you get an editor with:

  • Syntax highlighting for the active driver's dialect. The dialect (Postgres, MySQL, SQL Server, etc.) is selected automatically based on the connection.
  • Line numbers and active line highlighting, on by default.
  • Autocomplete that triggers as you type, with three sources combined:
    • SQL keywords for the active dialect.
    • Custom snippets (see below).
    • Schema-aware suggestions: table names from the connection's active database, and column names once you write <schema>.<table> or <table> and start typing a column.

There is no built-in SQL linter (errors come from the server when you run the query, not as you type).

Snippets

Seven SQL snippets are available out of the box. Type the prefix and pick the snippet from the autocomplete dropdown. Tab through the placeholders to fill them in.

PrefixExpands to
selectSELECT … FROM …
select_whereSELECT … FROM … WHERE …
insertINSERT INTO … (…) VALUES (…)
updateUPDATE … SET … WHERE …
deleteDELETE FROM … WHERE …
joinSELECT … FROM a JOIN b ON …
create_tableCREATE TABLE … ( … )

Editor keyboard shortcuts

ShortcutAction
Cmd+EnterRun the current query, or the selection if any
Cmd+Shift+FFormat the query
Shift+Alt+FFormat the query (alternative binding)

If text is selected when you press the run shortcut, only the selection is executed. With nothing selected, the whole tab is executed.

The MongoDB editor

When you open a query tab against a MongoDB connection, you get an editor optimized for the Mongo shell idiom:

  • JSON-aware syntax highlighting.
  • Mongo operator highlighting: tokens starting with $ (operators like $match, $set, $sum, etc.) are visually distinct from regular keys.
  • Real-time JSON linter that flags invalid JSON as you type. The linter is forgiving: it normalizes trailing commas, line comments, and single-quoted strings before validating, so the relaxed syntax most developers actually write works.
  • Autocomplete with four sources:
    • Collection names after typing db.
    • Mongo CRUD methods after typing db.<collection>. (18 methods, including find, findOne, aggregate, insertOne, updateMany, deleteOne, createIndex, etc.)
    • Mongo operators after typing $ (74 operators across query, logical, update, aggregation stage and aggregation expression categories)
    • Field names inferred from the targeted collection's sampled schema

There are no built-in snippets for MongoDB.

Aggregation pipelines

The editor highlights and autocompletes all standard aggregation stages ($match, $project, $group, $sort, $limit, $lookup, $facet, $bucket, $graphLookup, etc.). The client-side linter only validates JSON syntax; semantic validation happens server-side at execution.

Editor keyboard shortcuts

ShortcutAction
Cmd+EnterRun the current query, or the selection if any

Autocomplete behavior

Autocomplete activates as soon as you start typing (no manual trigger needed). To force the popup at any time, the standard CodeMirror binding is Ctrl + Space.

The schema-aware suggestions for SQL connections come from the same metadata QoreDB uses to populate the sidebar tree. If a table or column is missing from autocomplete, expanding the connection in the sidebar typically refreshes the cache.

Run vs run-selection

There is only one run shortcut, Cmd+Enter, but it adapts to context:

  • No selection: runs the entire tab.
  • Text selected: runs only the selection.

This means you can keep many statements in a single tab and run any one of them by selecting it before pressing the run shortcut. For multi-statement execution, see Running queries.

Where to go next

Newsletter

Stay updated on new releases

Subscribe to get product releases, new drivers notifications, and technical tutorials.

🎁 Bonus: Get our free SQL Performance Cheat Sheet — 9 pages, PostgreSQL / MySQL / SQLite (PDF)!