CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/golang-gorm-io--gorm

Full-featured ORM library for Golang with associations, hooks, transactions, migrations, and developer-friendly chainable API

Overall
score

81%

Overview
Eval results
Files

rubric.jsonevals/scenario-6/

{
  "context": "This criteria evaluates how well the engineer uses GORM's polymorphic association features to implement a comment system that works across multiple media types (posts, videos, images). The focus is on proper use of GORM's polymorphic relationship configuration and association handling.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Polymorphic tag usage",
      "description": "Correctly uses the `polymorphic` struct tag on the Comments field in Post, Video, and Image structs to configure the polymorphic association (e.g., `gorm:\"polymorphic:Commentable;\"`)",
      "max_score": 30
    },
    {
      "name": "Type and ID fields",
      "description": "Correctly defines CommentableID and CommentableType fields in the Comment struct to store the polymorphic owner information",
      "max_score": 20
    },
    {
      "name": "AutoMigrate usage",
      "description": "Uses GORM's AutoMigrate method to create the database schema for all models (Post, Video, Image, Comment)",
      "max_score": 10
    },
    {
      "name": "Association method",
      "description": "Uses GORM's Association().Append() or similar association methods to add comments to media entities rather than manually setting CommentableID and CommentableType",
      "max_score": 25
    },
    {
      "name": "Preload or Joins",
      "description": "Uses GORM's Preload() or Joins() method to eagerly load comments when querying for posts, videos, or images with their associated comments",
      "max_score": 15
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/golang-gorm-io--gorm

tile.json