How inxo/duckdbm works
Key Components to Include:
Core Components
• CLI Interface (Entry Point)
• Migration Manager
• Database Connector
• File System Handler
• Environment Manager
• Macro Processor
External Dependencies
• DuckDB Database
• Source Databases (e.g., MySQL for sync operations)
• Environment Files (.env)
• Migration Files
Component Details
a. User Interface Layer:
• CLI commands (init, create, apply, rollback, list, sync)
• To Command Handler
b. Processing Layer:
• Migration Manager (central component)
• Macro Processor (for handling {{ENV_VAR}} substitutions)
• Environment Manager (for .env file processing)
c. Storage Layer:
• DuckDB Database
• Migration Files Storage
• External Databases (for sync operations)
Specific Elements
a. Tables in DuckDB:
• migrations table
• sync table
• user tables (created by migrations)
b. File System Interactions:
• .env file reading
• SQL migration files
• Macro processing flow
c. External Systems:
• Connection to external databases (MySQL, etc.)
• Environment variable sources
Component Interactions
• How CLI commands flow through the system
• How migrations are processed and executed
• How macro substitution occurs
• How database operations are handled
• How sync operations interact with external databases