Skip to content

Conversation

@akindu-k
Copy link
Collaborator

@akindu-k akindu-k commented Jan 29, 2026

Description

This pull request introduces a new direct database access layer for MongoDB in the jac-scale project. It adds a Db class with standard CRUD operations, a get_db() helper, and comprehensive tests to ensure correct functionality. This enhancement allows users and internal code to interact with MongoDB directly, improving flexibility and developer experience.

Direct Database Access Layer:

  • Introduced Db class in jac_scale/db.jac that provides methods for find_one, find, insert_one, update_one, delete_one, and commit operations on MongoDB collections. Also added a get_db() function for obtaining a Db instance.
  • Implemented the logic for all Db methods in jac_scale/impl/db.impl.jac, including handling MongoDB connections and CRUD operations. The commit method is a no-op, reflecting MongoDB's behavior.

Testing and Documentation:

  • Added jac_scale/tests/test_db_direct.py to provide comprehensive tests for the new direct database access functionality, including setup/teardown of a MongoDB container and validation of all CRUD operations.
  • Updated the release notes in docs/docs/community/release_notes/jac-scale.md to document the introduction of direct database access and the new Db class.

Closes #4355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide direct DB access methods

2 participants