docs: add virtual-schemas specification#98
Merged
dimitri-yatsenko merged 3 commits intopre/v2.0from Jan 9, 2026
Merged
Conversation
Add comprehensive specification for virtual schema infrastructure: - Schema-module convention (1:1 mapping) - Schema introspection API (get_table, __getitem__, __iter__) - dj.virtual_schema() function - Table class generation - Use cases and examples Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create use-cli.md with comprehensive CLI documentation - Cover database credentials, schema loading, common workflows - Add to how-to index under Setup section Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5 tasks
Document persistent connection (singleton) vs context manager patterns for different use cases (interactive vs serverless). 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
This PR adds comprehensive documentation for DataJoint's virtual schema infrastructure and CLI.
Virtual Schema Specification
reference/specs/virtual-schemas.md- Complete specification covering:Core Concepts:
#,_,__) and automatic detectionSchema Introspection API:
Schema.get_table(name)- Direct table accessSchema.__getitem__- Bracket notation:schema['TableName']Schema.__iter__- Iterate tables in dependency orderSchema.__contains__- Check table existenceEntry Points:
dj.virtual_schema(schema_name)- Access existing database schemasdj.VirtualModule(alias, schema_name)- Create virtual modules with custom namesSchema.spawn_missing_classes()- Generate table classes dynamicallyUse Cases:
CLI How-To Guide
how-to/use-cli.md- Practical guide for thedjcommand:Getting Started:
djcommand--host,--user,--password)Schema Loading:
-s schema_name:alias)Common Workflows:
Reference:
djanddatajointcommands)Related
🤖 Generated with Claude Code