How tursodatabase/turso-client-php works
Main Components Identification
• PHP Extension Interface Layer
• Core LibSQL Implementation
• Connection Providers
• Utility Services
• External Systems Integration
[PHP Application Layer]
• ↓
[PHP Extension Interface]
• ↓
[Core LibSQL Implementation]
• ↓
[Connection Providers]
• ↓
[Database Backends]
Component Details
a) PHP Extension Interface (Top Layer):
• Main extension entry points (LibSQL class)
• Statement and transaction handlers
• Hooks system
b) Core Implementation (Middle Layer):
• Rust implementation components
• Generator and result handling systems
• Utility services (config, runtime, query params)
c) Connection Providers (Lower Layer):
• Local connections
• Remote connections
• Remote replica connections
• Memory connections
Specific Elements
[LibSQL PHP Class]
• ↓
[Hooks System] ← [Statement Handler]
• ↓ [Transaction Handler]
[Core Implementation]
• ↓
[Connection Providers] → [Local]
• → [Remote]
• → [Remote Replica]
• → [Memory]
Important Relationships
• Error handling paths with red lines
Technical Details to Highlight
• FFI boundary between PHP and Rust
• Where async operations occur
• Where configuration is applied
• Where connection pooling happens