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%
Build a task management system that supports both archiving (soft delete) and permanent deletion (hard delete) of tasks.
Implement a task management system with the following features:
Task Model: Create a Task model with fields for ID, title, description, completed status, and timestamps (including soft delete support).
Archive Task: Implement a function ArchiveTask(db, taskID) that archives (soft deletes) a task by its ID. Archived tasks should not appear in normal queries.
Permanently Delete Task: Implement a function PermanentlyDeleteTask(db, taskID) that permanently removes a task from the database, bypassing any soft delete mechanism.
List Active Tasks: Implement a function ListActiveTasks(db) that returns all non-archived tasks.
List Archived Tasks: Implement a function ListArchivedTasks(db) that returns only the archived tasks.
Bulk Archive Completed Tasks: Implement a function BulkArchiveCompletedTasks(db) that archives all tasks marked as completed.
task.go: Define the Task modeloperations.go: Implement all required functionsoperations_test.go: Test file with test casesProvides ORM functionality for database operations.
Provides SQLite database driver for GORM.
// File: operations_test.go
// Setup: Create 3 tasks
// Action: Archive task with ID 2
// Verify: ListActiveTasks returns 2 tasks (IDs 1 and 3)
// Verify: ListArchivedTasks returns 1 task (ID 2)// File: operations_test.go
// Setup: Create 2 tasks and archive task with ID 1
// Action: Call PermanentlyDeleteTask on task with ID 1
// Verify: ListArchivedTasks returns 0 tasks
// Verify: Database has only 1 task remaining (ID 2)// File: operations_test.go
// Setup: Create 5 tasks, mark 3 as completed
// Action: Call BulkArchiveCompletedTasks
// Verify: ListActiveTasks returns 2 tasks (uncompleted ones)
// Verify: ListArchivedTasks returns 3 tasks (completed ones)