This directory contains different examples demonstrating various ways to use Forge SQL ORM.
Minimal example showing how to use Drizzle ORM directly with Forge SQL using our custom driver. Perfect for projects that need only basic database operations without additional ORM features.
- Direct Drizzle ORM usage
- Custom Forge SQL driver
- Basic CRUD operations
- Type-safe queries
Basic example demonstrating core Forge SQL ORM features. Good starting point for new projects.
- Full ORM functionality
- Basic CRUD operations
- Query builder usage
- Simple database operations
Demonstrates how to use optimistic locking to prevent data conflicts in concurrent operations.
- Optimistic locking implementation
- Version field handling
- Conflict prevention
- Safe data updates
Shows how to work with dynamic queries and complex database operations.
- Dynamic query building
- Complex joins
- Advanced filtering
- Runtime query construction
Demonstrates query analysis capabilities for performance optimization and debugging. This example shows how to analyze and optimize database queries using TiDB's system schemas.
- Query plan analysis
- Slow query analysis
- Query history tracking
- Performance optimization tools
- Experimental features for development and troubleshooting
A practical example demonstrating how to work with complex database relationships and sequences. This example shows how to build an organization tracking system with user management.
- Joining tables with overlapping columns
- Using sequences for ID generation
- Complex queries with filtering
- User and organization management
- Search and filtering capabilities
A practical example demonstrating optimistic locking implementation in a real-world scenario. This example shows how to handle concurrent modifications in a checklist feature for Jira issues.
- Optimistic locking in a real application
- Concurrent modification handling
- Automatic conflict resolution
- User-friendly conflict notifications
- Default checklist initialization
- Two update modes comparison (with/without locking)
Advanced example demonstrating comprehensive caching capabilities and performance monitoring. This example showcases both local and global caching, automatic cache management, and detailed performance analysis.
- Query performance testing (cached vs non-cached)
- User & order management with automatic cache clearing
- Performance analysis with detailed monitoring
- Memory usage tracking and slow query detection
- Cache management and automatic invalidation
- Real-time performance metrics and execution plans
- Optional ID fields with auto-generation
- Modern React UI with detailed analytics
Each example includes its own README with detailed setup instructions and usage examples.