Draft
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
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.
This pull request introduces offline (SQLite-based) backend support to utilix, allowing core database and GridFS operations to work seamlessly when disconnected from the main MongoDB service. The main changes involve integrating the new
sqlite_backendand updating the relevant classes and methods to use it when configured.Offline backend integration:
sqlite_backendand its key classes/functions (OfflineGridFS,OfflineSQLiteCollection,SQLiteConfig,_load_sqlite_config) inutilix/__init__.py,utilix/mongo_storage.py, andutilix/rundb.pyto enable offline support throughout the package. [1] [2] [3]GridFS (file storage) offline support:
GridFsBaseclass inutilix/mongo_storage.pyto initialize and useOfflineGridFSwhen offline mode is detected, including offline-safe overrides for file listing, config existence checks, and file downloads. This ensures file storage and retrieval continue to work in offline scenarios. [1] [2]RunDB (database) offline support:
utilix/rundb.pyto provide an_sqlite_collectionfunction and updatexent_collectionto use the offline SQLite backend if enabled, allowing database queries to fallback to the local SQLite database when offline.General improvements and error handling:
Consistency and code reuse: