How wwalery/dbseeder works
Core Components
• Input Layer
• CSV File Reader
• File System Interface (for external files with @@ notation)
• Processing Layer
• Data Parser
• Reference Resolver
• SQL Generator
• Output Layer
• Database Writer
• Database Connectors (PostgreSQL, HSQL)
Data Flow Architecture
[CSV Files] → [Reader Layer] → [Processing Layer] → [Writer Layer] → [Database]
Detailed Component Breakdown:
A. Input Processing (Reader Layer):
• CSVReader component
• ReaderFactory for extensibility
• External file reader for @@ notation
• To IReader interface
B. Core Processing:
• DBSeeder as the central coordinator
• DBSSettings configuration component
• Data transformation components:
• DataRow processor
• ReferenceInfo resolver
• SeedInfo manager
C. Database Interface:
• SQLGenerator
• Database abstraction layer
• Specific database implementations
• Writer interface implementation
Visual Elements to Include:
Special Considerations:
Event listener system
• onRow
• onInsert
• onUpdate
• onAfterInsert
Configuration flow
• DBSSettings builder pattern
• Source type configuration
• Database connection settings
Reference resolution system
• How foreign key references are resolved
• Reference checking process
Data transformation pipeline
• CSV parsing
• Data type recognition
• Array handling (| delimiter)
• External file content inclusion
Key Relationships to Emphasize:
Event listener integration points
• Component types and their visual representations
• Special notations for listeners and hooks