Skip to content

feat(mongodb): MQL Query & Shell Console (#1030) - #1079

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1030-mongo-query-console
Oct 5, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1030-mongo-query-console

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Closes #1030

Summary of Changes

  • MQL Query & Shell Parser (MqlParser):
    • Implemented parser for MongoDB shell syntax:
      • Queries: find(), findOne(), count(), countDocuments(), aggregate()
      • Chained helper operators: .sort(), .limit(), .skip(), .project() / .projection()
      • CRUD/Mutations: insertOne(), insertMany(), updateOne(), updateMany(), deleteOne(), deleteMany(), drop()
      • Database commands: runCommand(), getCollectionNames(), stats()
      • Raw EJSON / JSON documents
    • Supported relaxed JavaScript object syntax: unquoted keys, single quotes, and constructor calls (ObjectId(...), ISODate(...), NumberLong(...), NumberInt(...), RegExp(...)).
  • Mongo Query Executor (MongoQueryExecutor):
    • Abstracted query execution interface with default implementation delegating directly to MongoService.
    • Captures execution duration, affected/retrieved counts, document results, and mutation status.
  • Mongo Query Workspace (MongoQueryWorkspace):
    • Multi-tab query editor using Querya UI Kit QueryaTabStrip.
    • Full-featured code editor with QueryaCodeEditor in JavaScript/MQL mode.
    • Keyboard shortcuts (Ctrl+Enter / Cmd+Enter) to execute queries.
    • Results bar displaying duration badge, result count badge, and Grid / JSON toggle buttons (MongoDocumentsTableView & MongoDocumentsJsonView).
    • Query history dialog displaying previously executed queries with insertion into active editor tab.
    • History persistence using LocalDb.instance.recordSqlQueryHistory.
  • Navigation Integration:
    • Added 'Console' button in MongoDocumentsView filter bar and 'MQL Console' button in MongoCollectionsView header.
    • Added _Level.queryConsole with breadcrumb navigation in MongoExplorerView.
  • Tests:
    • 13 comprehensive parser unit tests in test/features/mongodb/mql_parser_test.dart.
    • 6 widget tests in test/features/mongodb/mongo_query_workspace_test.dart covering tabs, shortcuts, error display, execution, and view mode switching.

@github-actions github-actions Bot added enhancement New feature or request editor Code/SQL editor ui User interface components and widgets backend Backend database driver execution and queries P2 Medium priority / Parity & Refactoring labels Oct 5, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit efd1136 into dev Oct 5, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend database driver execution and queries editor Code/SQL editor enhancement New feature or request P2 Medium priority / Parity & Refactoring ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant