# ojwanganto/sqleo architecture

> Architecture diagram of the GitHub repository ojwanganto/sqleo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ojwanganto/sqleo
- Repository: https://github.com/ojwanganto/sqleo

## Overview

##### Main Components Identification

The system should be divided into these primary components:

a) Core Application Layer:
- Environment Module (com.sqleo.environment)
- Query Builder Module (com.sqleo.querybuilder)
- Common Utilities (com.sqleo.common)

b) User Interface Layer:
- MDI (Multiple Document Interface) Components
- GUI Controls
- Dialogs and Windows

c) Database Connectivity Layer:
- JDBC Connection Management
- Connection Interceptors
- Database Metadata Handling

- [Presentation Layer]
- ↑↓
- [Business Logic Layer]
- ↑↓
- [Data Access Layer]
- ↑↓
- [External Database Systems]

##### Key Components

a) Core Modules:
- Application Controller (Application.java)
- Query Builder Engine (QueryBuilder.java)
- Metadata Explorer (MetadataExplorer.java)
- Command Editor (CommandEditor.java)

b) UI Components:
- Main Window (ClientFrame.java)
- Query Designer View
- Content View
- Metadata Browser

c) Data Access:
- Connection Assistant
- JDBC Wrappers
- SQL Command Interceptors

##### Relationships to Highlight

a) Data Flow:
- User Input → Query Builder → SQL Generation → Database
- Database → Metadata Explorer → UI Display
- Command Editor → SQL Execution → Result Display

b) Component Dependencies:
- How MDI components interact with core modules
- Connection management flow
- Query execution pipeline

##### Special Features

- Multi-language Support System
- SQL History Management
- Data Export/Import Functionality
- Query Visualization System
- Auto-completion System

##### Technical Details

Technical aspects:
**Supported Databases:**
- Oracle
- MySQL/MariaDB
- PostgreSQL
- SQLite
- Firebird
- Derby

**File Formats:**
- SQL (.sql)
- Query Layout (.xlq)
- CSV Export/Import
- Join Definitions (CSV)

##### Implementation Notes

- MVC pattern implementation
- Plugin architecture for database drivers
- Event-driven UI design
- Query builder visualization system
- SQL parsing and execution pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        UI_MAIN["Main Window"]:::ui
        UI_QD["Query Designer View"]:::ui
        UI_CV["Content View"]:::ui
        UI_MB["Metadata Browser"]:::ui
        UI_MDI["MDI Components"]:::ui
    end

    subgraph "Business Logic Layer"
        APP_CTRL["Application Controller"]:::logic
        QB_ENGINE["Query Builder Engine"]:::logic
        META_EX["Metadata Explorer"]:::logic
        CMD_ED["Command Editor"]:::logic
        SQL_HIST["SQL History Manager"]:::logic
        LANG["Multi-language Support"]:::logic
        VIS_SYS["Query Visualization System"]:::logic
        SQL_PROC["SQL Processing"]:::logic
    end

    subgraph "Data Access Layer"
        CONN_ASST["Connection Assistant"]:::data
        JDBC_WRAP["JDBC Wrappers"]:::data
        SQL_INT["SQL Interceptors"]:::data
        IMP_EXP["Data Import/Export"]:::data
    end

    subgraph "External Systems"
        DB_ORACLE["Oracle"]:::external
        DB_MYSQL["MySQL/MariaDB"]:::external
        DB_PGSQL["PostgreSQL"]:::external
        DB_SQLITE["SQLite"]:::external
        DB_OTHER["Other DBs"]:::external
    end

    %% Relationships
    UI_MAIN --> UI_MDI
    UI_MDI --> UI_QD
    UI_MDI --> UI_CV
    UI_MDI --> UI_MB

    UI_QD --> QB_ENGINE
    UI_MB --> META_EX
    UI_CV --> CMD_ED

    QB_ENGINE --> SQL_PROC
    QB_ENGINE --> VIS_SYS
    CMD_ED --> SQL_HIST
    
    SQL_PROC --> CONN_ASST
    META_EX --> CONN_ASST
    CMD_ED --> CONN_ASST

    CONN_ASST --> JDBC_WRAP
    JDBC_WRAP --> SQL_INT
    
    SQL_INT --> DB_ORACLE
    SQL_INT --> DB_MYSQL
    SQL_INT --> DB_PGSQL
    SQL_INT --> DB_SQLITE
    SQL_INT --> DB_OTHER

    IMP_EXP --> CONN_ASST

    %% Component Mappings
    click APP_CTRL "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/environment/Application.java"
    click QB_ENGINE "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/querybuilder/QueryBuilder.java"
    click META_EX "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/environment/ctrl/MetadataExplorer.java"
    click CMD_ED "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/environment/ctrl/CommandEditor.java"
    click CONN_ASST "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/common/jdbc/ConnectionAssistant.java"
    click UI_MAIN "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/common/gui/ClientFrame.java"
    click VIS_SYS "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/querybuilder/ViewDiagram.java"
    click SQL_PROC "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/querybuilder/syntax/SQLParser.java"
    click LANG "https://github.com/ojwanganto/SQLeo/tree/master/src/com/sqleo/common/locale"
    click SQL_HIST "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/common/util/SQLHistory.java"
    click UI_CV "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/environment/ctrl/content/ContentView.java"
    click IMP_EXP "https://github.com/ojwanganto/SQLeo/blob/master/src/com/sqleo/environment/ctrl/content/MaskExport.java"

    %% Styles
    classDef ui fill:#2374ab
    classDef logic fill:#57a773
    classDef data fill:#ff8c42
    classDef external fill:#848484
    classDef utility fill:#8c4799

    %% Legend
    subgraph Legend
        L_UI["UI Component"]:::ui
        L_LOGIC["Business Logic"]:::logic
        L_DATA["Data Access"]:::data
        L_EXT["External System"]:::external
    end
```
