Add CatalogStorage protocol and SQLite implementation#31
Merged
Conversation
Implement optional storage layer for catalog attach_id and transaction_id persistence: CatalogStorage protocol: - attach_put/get/delete/list - Manage attachment state - transaction_put/get/delete - Manage transaction state CatalogStorageSqlite implementation: - SQLite-backed storage with WAL mode for concurrent access - Default location: ~/.state/vgi/vgi_catalog.db - JSON serialization for options - Cascade delete of transactions when attachment is deleted - ID generation helpers (generate_attach_id, generate_transaction_id) - Cleanup utilities for old entries Adds 19 new tests for storage functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create CatalogClientMixin with all catalog operations: - Core infrastructure (_catalog_invoke, _catalog_invoke_stream) - Catalog lifecycle methods (catalogs, attach, detach, create, drop, version) - Transaction methods (begin, commit, rollback) - Schema methods (schemas, get, create, drop, contents) - Table methods (get, create, drop, rename, comment_set, column operations) - View methods (get, create, drop, rename, comment_set) - Integrate mixin into Client class - Delete standalone CatalogClient in favor of unified Client - Update exports in vgi/client/__init__.py - Fix worker to handle 0-row batches for no-arg methods - Fix worker to serialize list of primitives (e.g., catalogs()) - Add tests for Client catalog methods 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Expose catalog API via CLI subcommands: - catalog list/attach/detach/create/drop/version - schema list/get/create/drop/contents - table get/create/drop/rename/comment/scan-function + column ops - view get/create/drop/rename/comment - transaction begin/commit/rollback Refactored cli.py from @click.command to @click.group with invoke_without_command=True to preserve backward-compatible function invocation (--function) while adding subcommands. Added transaction methods and TransactionBeginResult to CatalogClientMixin for transaction support. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
Summary
CatalogStorageprotocol for catalog state persistenceCatalogStorageSqliteimplementation with SQLite backendvgi.catalogmoduleCatalogStorage Protocol
attach_put/get/delete/list- Manage attachment state (attach_id → catalog_name, options)transaction_put/get/delete- Manage transaction state (transaction_id → attach_id, state)CatalogStorageSqlite Features
~/.state/vgi/vgi_catalog.dbgenerate_attach_id(),generate_transaction_id()Test Coverage
Test plan
🤖 Generated with Claude Code