Skip to content

Conversation

@h3n4l
Copy link
Member

@h3n4l h3n4l commented Jan 27, 2026

Summary

  • Fix frontend JSON parsing error for SHOW COLLECTIONS, SHOW DATABASES, and db.getCollectionNames()
  • These commands now return JSON objects with a name field instead of plain strings

Test plan

  • All existing tests pass
  • Updated tests to verify JSON format output

🤖 Generated with Claude Code

SHOW COLLECTIONS, SHOW DATABASES, and db.getCollectionNames() returned
plain strings which couldn't be parsed by the frontend's lossless-json.
Now returns JSON objects with a "name" field: {"name": "collection_name"}

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings January 27, 2026 03:30
Copy link

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 pull request fixes a frontend JSON parsing error by changing the output format of SHOW COLLECTIONS, SHOW DATABASES, and db.getCollectionNames() commands to return JSON objects with a name field instead of plain strings.

Changes:

  • Modified executeShowDatabases and executeShowCollections to wrap names in JSON objects with {"name": <name>} format
  • Updated all test cases to unmarshal and validate JSON object format
  • Added helper functions in tests to check for database/collection names in JSON format

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
internal/executor/server.go Modified executeShowDatabases to return JSON objects with "name" field instead of plain strings
internal/executor/database.go Modified executeShowCollections to return JSON objects with "name" field instead of plain strings
database_test.go Updated tests to parse and validate JSON object format; removed unused slices import
admin_test.go Updated tests to use helper functions that parse JSON objects; removed unused slices import; added containsCollectionName and containsDatabaseName helper functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rebelice rebelice merged commit 3b10cff into main Jan 27, 2026
8 checks passed
@rebelice rebelice deleted the vk/0a50-yo-we-had-implem branch January 27, 2026 03:35
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