tessl install tessl/golang-gorm-io--gorm@1.31.0Full-featured ORM library for Golang with associations, hooks, transactions, migrations, and developer-friendly chainable API
Agent Success
Agent success rate when using this tile
81%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.13x
Baseline
Agent success rate without this tile
72%
A utility that processes large datasets from a database efficiently and generates summary reports without loading all records into memory at once.
@generates
package processor
import (
"gorm.io/gorm"
)
// UserRecord represents a user in the database
type UserRecord struct {
ID uint `gorm:"primaryKey"`
Name string
Email string
IsActive bool
Age int
}
// OrderRecord represents an order in the database
type OrderRecord struct {
ID uint `gorm:"primaryKey"`
UserID uint
Amount float64
Status string
}
// ProcessUserBatches processes user records in batches and executes a callback for each batch.
// Returns the total number of records processed and any error encountered.
func ProcessUserBatches(db *gorm.DB, batchSize int, callback func(users []UserRecord) error) (int, error)
// CountActiveUsers counts the total number of active users by processing records in batches.
func CountActiveUsers(db *gorm.DB, batchSize int) (int, error)
// CalculateTotalRevenue calculates the total revenue from completed orders by processing in batches.
func CalculateTotalRevenue(db *gorm.DB, batchSize int) (float64, error)Provides ORM functionality for database operations including batch processing.
@satisfied-by