Skip to content

feat: implement MVP of gomongo library#1

Merged
h3n4l merged 2 commits intomainfrom
vk/4ff2-mvp-of-gomongo
Jan 14, 2026
Merged

feat: implement MVP of gomongo library#1
h3n4l merged 2 commits intomainfrom
vk/4ff2-mvp-of-gomongo

Conversation

@h3n4l
Copy link
Copy Markdown
Member

@h3n4l h3n4l commented Jan 14, 2026

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)
  • Collection access via dot notation (db.users), bracket notation (db["user-logs"]), and getCollection()
  • Extended JSON (Relaxed) output format
  • Parse errors with line/column information
  • Unsupported operation errors with hints

Not yet supported (future PRs):

  • 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

Test plan

  • go build ./... passes
  • golangci-lint run passes with no issues
  • go test -v ./... passes (integration tests with MongoDB testcontainer)

🤖 Generated with Claude Code

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>
@h3n4l h3n4l force-pushed the vk/4ff2-mvp-of-gomongo branch from c9995d3 to c89b250 Compare January 14, 2026 03:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 d-bytebase requested a review from rebelice January 14, 2026 04:02
@h3n4l h3n4l merged commit 53c998e into main Jan 14, 2026
2 checks passed
@h3n4l h3n4l deleted the vk/4ff2-mvp-of-gomongo branch January 14, 2026 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants