How jetbrains/exposed works
Main Components (Top Level)
┌─────────────────────────────────────────────────────────────────┐
• Exposed Framework │
• ┬────────────┬────────────────────┬─────────────────┤
• Core │ DAO │ DSL │ Extensions │
• Module │ Module │ Module │ Modules │
• ┴────────────┴────────────────────┴─────────────────┘
Core Architecture Layers
┌─────────────────────────────────────────────────────────────────┐
• Application Layer │
• ┤
• Exposed Framework Layer │
• ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────┐ │
• DSL │ │ DAO │ │Transaction│ │ Schema │ │
• Query │ │ Entity │ │Management │ │ Management │ │
• ┘ └──────────┘ └──────────┘ └──────────────┘ │
• ┤
• Database Layer │
• ┘
Module Dependencies
┌─────────────────────┐
• exposed-core │◄─────────────────┐
• ┘ │
• ▲ │
┌─────────────────────┐ ┌────────────┴────────┐
• exposed-dao │ │ exposed-jdbc │
• ┘ └───────────┬─────────┘
• ▲ │
• ▼
┌─────────────────────┐ ┌───────────────────┐
• Extension Modules │ │ Database Drivers │
• ┘ └───────────────────┘
Key Components
a. Core Components:
• Table Definitions
• Column Types
• Query Building
• Transaction Management
• Schema Utils
b. DSL Features:
• SQL Expression Builder
• Join Operations
• Where Conditions
• /Order Operations
c. DAO Components:
• Entity Definitions
• Entity ID Management
• References/Relations
• CRUD Operations
d. Extension Support:
• Date/Time Handlers
• JSON Support
• Cryptography
• Spring Integration
Database Support Layer
┌─────────────────────────────────────────────────────────────┐
• Database Abstraction │
• ┬──────────┬───────────┬──────────────┬───────────┤
• H2 │ MySQL │ PostgreSQL│ SQLServer │ SQLite │
• ┴──────────┴───────────┴──────────────┴───────────┘
Integration Points
┌─────────────────────────────────────────────────────────────┐
• Framework Integration │
• ┬────────────────┬──────────────┬─────────────┤
• Spring Boot │ Ktor │ Kotlin │ Java │
• Starter │ Integration │ Coroutines │ Time │
• ┴────────────────┴──────────────┴─────────────┘
Important Considerations:
Data flow
• Application → DSL/DAO → Transaction Manager → Database
• Error handling paths
• Transaction boundaries