SwordJack: Feature Database Service - #19
Merged
Merged
Conversation
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.
Hi all,
This PR introduces the
isobase.databasemodule, establishing a general-purpose, unified persistence boundary for IsoBase applications. By extracting and formalizing database operations, it replaces the ad-hoc SQLite implementation previously embedded in theworkflowmodule, providing a solid foundation for both document/state storage and structured application data.Description
This PR accomplishes the following:
New Database Module (
isobase.database)mongo.py): AddsMongoDbServiceandMongoDbModelproviding document CRUD, querying (find_many,count, etc.), schema management, and transaction wrapping.sql.py): AddsSqlDbServiceandSqlDbModelMixinwrapping SQLAlchemy, compatible with SQLite and PostgreSQL. Provides standard repository-pattern operations matching the MongoDB API naming style.execute_transaction,insert,delete_many,mongo_db,sql_db) to keep API surfaces predictable across backends.Workflow Module Refactoring
isobase/workflow/database.pythat handled SQLite state sync.ExecutionEntity) to use the newisobase.database.sqlmodule (isobase/workflow/models.py).workflowmodule to cleanly depend on the shareddatabaselayer rather than managing its own connections.isobase/workflow/README.mdto reflect the new state management architecture.Testing & Tooling
test_integration_mongo.py) and PostgreSQL (test_integration_postgres.py) instances.test_sql.py).pyproject.toml,environment.yml, and condarecipe.yamlto includepymongo,sqlalchemy, andpsycopg2-binary.Testing
test/databasepass.python -m pytest test/database/.Future Work
This module establishes the data storage base. Future PRs will build upon this to add vector storage abstractions (e.g.,
pgvector) and knowledge-base document chunking for Retrieval-Augmented Generation (RAG) capabilities.Best,
SwordJack.