How hamin/jlq works
Main Components
a) Input Layer:
• JSON Log Files Handler
• Command Line Interface (CLI) Parser
b) Processing Layer:
• SQLite Engine Interface
• JSON Processing Module
• File Tailing System
c) Storage Layer:
• In-Memory SQLite Storage
• On-Disk SQLite Storage
Component Relationships
Input -> Processing -> Storage/Output
Specific Implementation Details
• Rectangles: Core processing components
• Parallelograms: Input/Output components
• Diamonds: Decision points (e.g., in-memory vs. on-disk storage)
• Blue: Input components
• Green: Processing components
• Orange: Storage components
• Gray: External dependencies (SQLite)
Detailed Component Breakdown
[Input Layer]
• JSON Log Files (Input) → File Reader
• CLI Arguments → Args Parser
• Query Parameters
• Flags (-t, -m, -v, -d)
[Processing Layer]
• SQLite Query Executor
• JSON1 Extension Functions
• File Tailing System (when -t flag is used)
• JSON Parser
[Storage Layer]
• In-Memory SQLite (-m flag)
• On-Disk SQLite (default: jql.db)
Important Flows to Highlight
• Main data flow:
1. JSON log files → Parser → SQLite Storage
2. Query execution path
3. Tailing mechanism for real-time monitoring
Additional Elements
• Version information (0.1.0)
• Dependencies (SQLite, Rust)
• Async operations (file tailing)
Technical Details
• SQLite JSON1 extension integration
• File watching mechanism for tail mode
• Memory management for in-memory vs. on-disk modes
• Query execution flow