How nullism/bqb works
Main Components
a) Core Components:
• Query Builder Core (central component)
• Parameter Processing System
• SQL Dialect Handlers (MySQL/PostgreSQL/SQLite)
• Type System
b) Integration Points:
• database/sql Interface
• External DB Drivers (pq, pgx, sqlx)
Component Relationships
┌─────────────────────────────────────────────────────────────┐
• BQB Query Builder │
• ┤
• ┌─────────────┐ ┌──────────────┐ │
• Query Builder│◄─────►│Parameter │ │
• Core │ │Processor │ │
• ┘ └──────────────┘ │
• ▲ ▲ │
• ▼ ▼ │
• ┌─────────────┐ ┌──────────────┐ │
• Type System │◄─────►│SQL Dialect │ │
• Handler │ │Handlers │ │
• ┘ └──────────────┘ │
• ▲ ▲ │
• ┼──────────────────────┼───────────────────────────┘
• ┌─────┴──────┐ ┌─────┴──────┐
• database/sql│ │External DB │
• Interface │ │Drivers │
• ┘ └────────────┘
Important Details
a) Core Features:
• Query building methods (Space, And, Or, Comma)
• Parameter substitution (?/$ handling)
• Type conversion system
• JSON support
b) Integration Points:
• Database driver compatibility
• SQL dialect support
• Value embedding system
Data Flow Indicators
Following flows:
• Query building process
• Parameter processing
• Type conversion
• SQL dialect transformation
The clear separation between query building and parameter processing
Keep the abstraction level focused on the core architectural components while showing enough detail to understand the query building and processing flow. This will help developers understand how to integrate and extend the library effectively.