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
Jira global page example using Forge UI Kit (@forge/react) with Forge SQL ORM and Drizzle. Demonstrates CRUD on a users table with native Forge components (no Custom UI).
- Forge UI Kit only (Form, DynamicTable, Textfield, Button, etc.)
- Create, list, and update users via resolvers
- Drizzle schema and migrations (apply on install and hourly)
- Resolvers:
createUser,fetchUsers,updateUsers
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
Atlas Camp 2026 - February 9, 2026
Demonstration application showcasing advanced Forge SQL ORM capabilities for Atlas Camp presentation. Features complex ACL (Access Control List) system, query caching, performance optimization, error handling, and large-scale data operations.
- Complex ACL system with 12 interconnected tables (users, roles, permissions, documents, ACL)
- Query caching with
selectDistinctCacheable()for permission lookups - Performance monitoring with automatic slow query detection (>500ms)
- Error handling for timeout and Out of Memory scenarios
- Automatic schema migrations with async queue processing
- Database seeding (300 users, 30,000 documents, 300,000 ACL entries)
- Scheduled triggers for migrations, slow query analysis, and cache cleanup
- Async queues for degradation monitoring and long-running migrations
- React-based frontend with interactive query execution
Each example includes its own README with detailed setup instructions and usage examples.