Conversation
Implement the initial version of gomongo - a Go library that parses MongoDB shell syntax and executes commands using the native Go MongoDB driver. MVP scope (matching bytebase/bytebase#18883): - db.collection.find() - returns all documents (filter parsed but ignored) - Collection access via dot notation, bracket notation, and getCollection() - Extended JSON (Relaxed) output format - Parse errors with line/column information - Unsupported operation errors with hints Not yet supported: - Filter support for find() - findOne() - Cursor modifiers (sort, limit, skip, projection) - Helper functions (ObjectId, ISODate, UUID, etc.) - Shell commands (show dbs, show collections) Also includes: - GitHub Actions workflows for tests and linting - Integration tests using testcontainers - ANTLR replace directive for Bytebase's optimized fork 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
c9995d3 to
c89b250
Compare
There was a problem hiding this comment.
Pull request overview
This PR implements the MVP version of gomongo, a Go library that parses MongoDB shell syntax and executes commands using the native Go MongoDB driver. The implementation provides basic find() operation support with proper error handling and integration testing.
Changes:
- Implements core parsing and execution pipeline using ANTLR-based MongoDB parser
- Adds comprehensive integration tests with testcontainers for MongoDB
- Sets up GitHub Actions workflows for automated testing and linting
Reviewed changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| go.mod | Module definition with dependencies and ANTLR replace directive |
| go.sum | Dependency checksums |
| client.go | Public API with Client wrapper and Execute method |
| executor.go | Core execution pipeline: parsing, translation, and operation execution |
| translator.go | ANTLR visitor implementation for extracting operations from parse tree |
| errors.go | Custom error types for parse and unsupported operation errors |
| executor_test.go | Integration tests covering find operations and error scenarios |
| README.md | User documentation with usage examples and feature status |
| CLAUDE.md | Developer guidance for AI assistants |
| .github/workflows/tests.yml | GitHub Actions workflow for running tests |
| .github/workflows/lint.yml | GitHub Actions workflow for linting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d-bytebase
approved these changes
Jan 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement the initial version of gomongo - a Go library that parses MongoDB shell syntax and executes commands using the native Go MongoDB driver, eliminating the need for external mongosh CLI.
MVP scope (matching bytebase/bytebase#18883):
db.collection.find()- returns all documents (filter parsed but ignored)db.users), bracket notation (db["user-logs"]), andgetCollection()Not yet supported (future PRs):
find()findOne()Also includes:
Test plan
go build ./...passesgolangci-lint runpasses with no issuesgo test -v ./...passes (integration tests with MongoDB testcontainer)🤖 Generated with Claude Code