How ncruces/go-sqlite3 works
Core Components (Main Layer)
• WebAssembly runtime (wazero) as a fundamental component
• Embedded SQLite WASM build (from /embed directory)
Interface Layers
a. Top Layer (Client Interface):
• Database/SQL Driver interface
• GORM Driver interface (gormlite)
• Direct SQLite C API wrapper
b. Bottom Layer (System Interface):
• Virtual File System (VFS) implementation
• OS Interface adaptations
Extension System
• Array operations
• Blob I/O
• CSV handling
• Hash functions
• Statistics
• Unicode support
• UUID handling
• Other extensions
Virtual File System Components
VFS implementations:
• Memory DB
• Reader VFS
• Encryption (Adiantum, XTS)
• OS-specific implementations
Use the following visualization guidelines:
Component Representation
• Use rectangles for main components
• Use hexagons for interfaces
• Use clouds for external dependencies
Connection Types
• [Client Applications]
• ↓
• [Database/SQL Driver] → [GORM Driver]
• ↓
• [SQLite Wrapper Core] ← [Extensions]
• ↓
• [Wazero Runtime] → [SQLite WASM]
• ↓
• [VFS Layer] → [OS Interface]
Important Details
• Separation between pure Go and WASM components
• Cross-platform support
• Security features (encryption)
• Test coverage integration