Skip to content

DigantaSen/Data-Dictionary-Tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Data Dictionary Tool - Relational Database Schema Analyzer

Overview

This comprehensive Data Dictionary Tool is designed to read, analyze, and document relational database schemas. It provides a complete solution for database documentation with visual relationship diagrams, detailed data dictionaries, and export capabilities.

🌟 Key Features

πŸ“Š Multiple Input Formats

  • JSON Schema: Structured JSON format with tables, columns, and relationships
  • XML Schema: Standard XML database definition format
  • SQL DDL: Direct SQL CREATE TABLE statements with foreign keys

🎯 Comprehensive Analysis

  • Table Schema Parsing: Extract table names, descriptions, and column definitions
  • Relationship Detection: Identify foreign key relationships and dependencies
  • Constraint Analysis: Parse primary keys, foreign keys, unique constraints, and more
  • Data Type Recognition: Support for all standard SQL data types

πŸ“ˆ Visual Documentation

  • Interactive Relationship Diagrams: Visual representation of table relationships
  • Professional Styling: Clean, modern interface with responsive design
  • Real-time Updates: Instant visualization as you input schema data

πŸ“š Documentation Generation

  • Comprehensive Data Dictionary: Detailed table and column documentation
  • Alphabetical Glossary: Searchable reference of all database terms
  • Relationship Analysis: Complete foreign key relationship mapping

πŸ’Ύ Export Capabilities

  • HTML Export: Standalone HTML documentation files
  • PDF Export: Print-ready PDF documentation
  • Full Reports: Comprehensive analysis with all components

πŸš€ How to Use

Step 1: Choose Input Format

Select your preferred input format from the tabs:

  • JSON: For structured data exchange
  • XML: For standard database definitions
  • SQL DDL: For direct SQL statements

Step 2: Input Your Schema

Either:

  • Paste your database schema in the selected format
  • Click "Load Sample Data" to see an example
  • Use the provided templates and examples

Step 3: Parse and Analyze

Click "Parse Schema" to:

  • Validate the input format
  • Extract table and relationship information
  • Generate comprehensive analysis

Step 4: View Results

Switch between output tabs to view:

  • Relationship Diagram: Visual table connections
  • Data Dictionary: Detailed documentation
  • Table Glossary: Alphabetical reference

Step 5: Export Documentation

Choose from export options:

  • Export HTML: Standalone documentation
  • Export PDF: Print-ready format
  • Full Report: Complete comprehensive analysis

πŸ“‹ Input Format Examples

JSON Format

{
  "database": "ecommerce_db",
  "tables": [
    {
      "name": "customers",
      "description": "Customer information table",
      "columns": [
        {
          "name": "customer_id",
          "type": "INT",
          "constraints": ["PRIMARY KEY", "AUTO_INCREMENT"],
          "description": "Unique customer identifier"
        },
        {
          "name": "email",
          "type": "VARCHAR(255)",
          "constraints": ["UNIQUE", "NOT NULL"],
          "description": "Customer email address"
        }
      ]
    }
  ],
  "relationships": [
    {
      "type": "foreign_key",
      "from_table": "orders",
      "from_column": "customer_id",
      "to_table": "customers",
      "to_column": "customer_id"
    }
  ]
}

XML Format

<database name="ecommerce_db">
  <tables>
    <table name="customers" description="Customer information table">
      <columns>
        <column name="customer_id" type="INT" constraints="PRIMARY KEY,AUTO_INCREMENT" description="Unique customer identifier" />
        <column name="email" type="VARCHAR(255)" constraints="UNIQUE,NOT NULL" description="Customer email address" />
      </columns>
    </table>
  </tables>
  <relationships>
    <relationship type="foreign_key" from_table="orders" from_column="customer_id" to_table="customers" to_column="customer_id" />
  </relationships>
</database>

SQL DDL Format

CREATE TABLE customers (
    customer_id INT PRIMARY KEY AUTO_INCREMENT,
    first_name VARCHAR(100) NOT NULL,
    email VARCHAR(255) UNIQUE NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE orders (
    order_id INT PRIMARY KEY AUTO_INCREMENT,
    customer_id INT NOT NULL,
    total_amount DECIMAL(10,2) NOT NULL,
    FOREIGN KEY (customer_id) REFERENCES customers(customer_id)
);

🎨 Features Breakdown

Visual Relationship Diagram

  • Interactive Table Nodes: Clickable table representations
  • Relationship Lines: Visual foreign key connections
  • Color-coded Constraints: Primary keys, foreign keys clearly marked
  • Responsive Layout: Automatic positioning and scaling

Data Dictionary Components

  • Database Overview: Summary statistics and metadata
  • Table Details: Complete column specifications
  • Constraint Analysis: All database constraints documented
  • Relationship Mapping: Foreign key relationship details

Export Features

  • HTML Documentation: Self-contained web pages
  • PDF Reports: Professional print format
  • Comprehensive Reports: All analysis combined
  • Custom Formatting: Professional styling included

πŸ”§ Technical Implementation

Architecture

  • Pure JavaScript: No external framework dependencies
  • Modular Design: Separated parsing, analysis, and rendering
  • Error Handling: Comprehensive validation and error reporting
  • Responsive UI: Mobile-friendly interface

Supported Database Features

  • Table Definitions: Names, descriptions, and metadata
  • Column Specifications: Data types, sizes, and properties
  • Constraint Types: Primary keys, foreign keys, unique, not null
  • Relationship Types: One-to-one, one-to-many, many-to-many
  • Data Types: All standard SQL data types supported

Browser Compatibility

  • Modern Browsers: Chrome, Firefox, Safari, Edge
  • Responsive Design: Works on desktop, tablet, and mobile
  • No Server Required: Runs entirely in the browser
  • Local Processing: All data remains client-side

πŸ“– Use Cases

Database Documentation

  • Development Teams: Maintain up-to-date schema documentation
  • Database Administrators: Generate comprehensive database reports
  • Project Managers: Understand database structure and relationships
  • Quality Assurance: Validate database design and constraints

Educational Purposes

  • Database Courses: Teach relational database concepts
  • Schema Design: Visualize and understand database relationships
  • Documentation Standards: Learn proper database documentation practices

Migration Projects

  • Legacy Systems: Document existing database structures
  • System Integration: Understand data relationships
  • Architecture Planning: Analyze database dependencies

πŸ› οΈ Files Structure

Q5/
β”œβ”€β”€ index.html          # Main application interface
β”œβ”€β”€ style.css           # Professional styling and responsive design
β”œβ”€β”€ script.js           # Core application logic and parsers
└── README.md           # This comprehensive documentation

πŸ” Quality Assurance

Input Validation

  • Format Checking: Validates JSON, XML, and SQL syntax
  • Schema Validation: Ensures required fields are present
  • Relationship Validation: Verifies foreign key references
  • Error Reporting: Clear, actionable error messages

Output Quality

  • Professional Styling: Clean, modern documentation
  • Complete Coverage: All schema elements documented
  • Cross-references: Linked relationships and references
  • Export Integrity: Consistent formatting across export formats

πŸš€ Getting Started

  1. Open the Tool: Load index.html in a web browser
  2. Choose Format: Select JSON, XML, or SQL input format
  3. Load Example: Click "Load Sample Data" to see a working example
  4. Input Schema: Paste your database schema or modify the sample
  5. Parse Schema: Click "Parse Schema" to analyze the data
  6. Explore Results: Use the output tabs to view different analyses
  7. Export Documentation: Choose your preferred export format

πŸ’‘ Tips for Best Results

Input Preparation

  • Complete Schemas: Include all tables and relationships
  • Descriptive Names: Use clear, meaningful table and column names
  • Add Descriptions: Include detailed descriptions for better documentation
  • Validate Syntax: Ensure your input format is correct

Output Optimization

  • Review Diagrams: Check relationship visualizations for accuracy
  • Verify Documentation: Ensure all components are properly documented
  • Test Exports: Verify exported files meet your requirements
  • Customize as Needed: Use exports as base for further customization

🎯 Advanced Features

Relationship Analysis

  • Dependency Mapping: Understand table dependencies
  • Referential Integrity: Verify foreign key relationships
  • Cascade Analysis: Identify update and delete cascades

Documentation Standards

  • Professional Formatting: Industry-standard documentation
  • Comprehensive Coverage: All database elements included
  • Version Control: Export timestamped documentation
  • Team Collaboration: Shareable documentation formats

Created for Educational and Professional Use - A comprehensive tool for database schema analysis and documentation.

πŸ“ž Support and Contribution

This tool is designed to be self-contained and easy to use. For educational purposes, it demonstrates:

  • Database schema parsing and analysis
  • Visual relationship diagram generation
  • Professional documentation creation
  • Modern web application development

The implementation showcases best practices in:

  • Client-side data processing
  • Responsive web design
  • Error handling and validation
  • Export functionality development

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published