A powerful Visual Studio Code extension for working with A5:ER (Entity Relationship) database design files. This extension provides preview capabilities and seamless conversion between A5:ER format and JSON format, making it easier to work with AI/LLM tools for database design assistance.
Features
🔍 A5:ER File Preview
- Visual preview of A5:ER files directly in VS Code
- Entity-Relationship diagram visualization
- Table structure display with fields, types, and constraints
- Real-time preview updates as you edit
- A5:ER to JSON: Convert A5:ER files to structured JSON format for easy processing by AI/LLM tools
- JSON to A5:ER: Convert JSON back to A5:ER format to maintain compatibility with A5:SQL tools
- Preserves all metadata including:
- Entity names (logical and physical)
- Field definitions with data types
- Primary key and foreign key relationships
- Default values and comments
- Entity positioning information
- Relationship mappings
 
🤖 AI/LLM Integration Ready
The JSON format is specifically designed to be easily readable and processable by Large Language Models, enabling:
- Database schema analysis
- Automated documentation generation
- Schema optimization suggestions
- Code generation from database design
Installation
From VS Code Marketplace
- Open VS Code
- Go to Extensions (Ctrl+Shift+X)
- Search for "pengent-a5er-tools"
- Click Install
From VSIX File
- Download the .vsixfile from releases
- Open VS Code
- Press Ctrl+Shift+Pto open Command Palette
- Type "Extensions: Install from VSIX..."
- Select the downloaded .vsixfile
Usage
Preview A5:ER Files
- Open any .a5erfile in VS Code
- Right-click in the editor and select "Preview A5er File"
- Or press Ctrl+Shift+Pand type "Preview A5er File"
 
- A preview panel will open showing the entity-relationship diagram
Convert A5:ER to JSON
- Open a .a5erfile in VS Code
- Right-click and select "Convert A5:ER to A5ER.JSON"
- Or use Command Palette: Ctrl+Shift+P→ "Convert A5:ER to A5ER.JSON"
 
- A new .a5er.jsonfile will be created and opened alongside your original file
Convert JSON back to A5:ER
- Open a .a5er.jsonfile in VS Code
- Right-click and select "Convert A5ER.JSON to A5:ER"
- Or use Command Palette: Ctrl+Shift+P→ "Convert A5ER.JSON to A5:ER"
 
- A new .a5erfile will be generated
The converted JSON follows this structure:
{
  "project": {
    "name": "Project Name",
    "author": "Author Name",
    "rdbms": "Database Type"
  },
  "entities": [
    {
      "name": "table_name",
      "logical_name": "テーブル名",
      "fields": [
        {
          "name": "field_name",
          "logical_name": "フィールド名",
          "type": "VARCHAR(50)",
          "not_null": true,
          "pk": false,
          "default": "default_value",
          "comment": "Field description"
        }
      ],
      "position": {
        "page": "Main",
        "left": 100,
        "top": 200
      }
    }
  ],
  "relations": [
    {
      "from": "parent_table",
      "to": "child_table",
      "from_field": "id",
      "to_field": "parent_id",
      "type": "1:N"
    }
  ]
}
Supported A5:ER Features
✅ Fully Supported:
- Entity definitions (logical and physical names)
- Field definitions with all data types
- Primary key constraints
- Foreign key relationships
- Default values
- Field comments
- Entity positioning
- Project metadata
⚠️ Partially Supported:
- Complex relationship types (converted to standard 1:N, N:1 format)
- Advanced A5:ER formatting options
Use Cases
Database Documentation
Convert your A5:ER files to JSON and use AI tools to generate comprehensive documentation:
# Example workflow
1. Convert schema.a5er → schema.a5er.json
2. Process with AI/LLM for documentation
3. Generate markdown/HTML documentation
Schema Analysis
Use the JSON format for automated analysis:
- Identify naming convention violations
- Find missing foreign key relationships
- Detect potential performance issues
- Generate test data schemas
Code Generation
Convert database designs to application code:
- Generate ORM models
- Create API endpoints
- Build database migration scripts
- Generate CRUD operations
Requirements
- Visual Studio Code 1.101.0 or higher
- A5:ER files created with A5:SQL Mk-2 or compatible tools
Extension Settings
This extension contributes the following settings:
Currently no configurable settings. Settings will be added in future versions based on user feedback.
Known Issues
- Large A5:ER files (>1000 entities) may experience slower preview rendering
- Complex nested relationships might not display perfectly in preview mode
- Unicode characters in Japanese field names display correctly in JSON but may have encoding issues in some environments
Release Notes
0.0.1
- Initial release
- A5:ER file preview functionality
- Bidirectional A5:ER ↔ JSON conversion
- Context menu integration
- Command palette support
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
Development Setup
- Clone the repository
- Run npm installto install dependencies
- Press F5to open a new Extension Development Host window
- Test your changes
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Acknowledgments
- A5:SQL Mk-2 by m.matsubara for the original A5:ER format specification
- VS Code team for the excellent extension API
- The open-source community for inspiration and feedback
Made with ❤️ for database designers and developers