thing

A usage guide for Thing ORM, a Go library that maps program data to database records. It covers create, read, update, and delete operations, caching, type-safe Go generics, and MySQL, PostgreSQL, and SQLite.

In plain words
What is it for?
Configuring database and cache connections, creating model-specific ORM instances, and working with stored records and lists in Go.
Why use it?
It gives developers a reference for setting up the library and using its database and cache features. This avoids guessing at the configuration and data-access patterns.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/burugo/one-mcp/thing
Clone the repo
git clone --depth 1 https://github.com/burugo/one-mcp

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,541 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02541
Opus 5 $0.00000 $0.01270
Sonnet 5 $0.00000 $0.00508
Haiku 4.5 $0.00000 $0.00254

Measured yesterday against content hash 915b023f6220, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

thing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

  • thing — 100% identical, 0 lines differ
.cursor/rules/thing.mdc · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.


description: globs: *.go alwaysApply: false

Rule Name: Thing ORM Usage Guide

Description:

Quick reference for using the Thing ORM (github.com/burugo/thing).

Core Concept

  • High-performance Go ORM focusing on CRUD and list operations.
  • Built-in caching (Redis or in-memory) automatically handles single-entity and list query caching & invalidation.
  • Uses Go generics for type safety and a cleaner API.
  • Supports MySQL, PostgreSQL, SQLite.

Configuration

  1. Create DB Adapter:
    import "github.com/burugo/thing/drivers/db/sqlite" // Or mysql, postgres
    dbAdapter, err := sqlite.NewSQLiteAdapter(":memory:")
    
  2. Create Cache Client (Optional, defaults to in-memory):
    import (
        "github.com/redis/go-redis/v9"
        redisCache "github.com/burugo/thing/drivers/cache/redis"
        "github.com/burugo/thing"
    )
    // Use nil for default in-memory:
    // var cacheClient thing.CacheClient = nil
    // Or Redis:
    // rdb := redis.NewClient(...)
    // cacheClient = redisCache.NewClient(rdb)
    
  3. Get ORM Instance per Model:
    import "github.com/burugo/thing"
    // import your models package
    
    // For a specific model typels.User)
    userThing, err := thing.New[*models.User](mdc:db)
    
    Alternative Global Config (less flexible): thing.Configure(dbAdapter, cacheClient) then thing.Use[*Model]().

Basic Usage

  1. Model Definition: Embed thing.BaseModel and use db tags for columns.
    type User struct {
        thing.BaseModel // Includes ID, CreatedAt, UpdatedAt, DeletedAt
        Name string `db:"name"` // Explicitly maps Name field to 'name' column
        UserAge int // db tag omitted, defaults to 'user_age' column
    }
    // Optional: Define TableName() method if different from snake_case plural struct name.
    // func (u *User) TableName() string { return "custom_users_table" }
    
    Note: While using the db tag is recommended for clarity, it's technically optional. If omitted, Thing ORM defaults to converting the Go field name (CamelCase, e.g., UserAge) to its snake_case equivalent (user_age) as the database column name. Use db:"-" to explicitly ignore a field.

Read the full file on GitHub · 237 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 237 lines · 2,541 tokens per session scan A 915b023f6220

Subscribe to this mod's changes

thing is a cursor rule published in the GitHub repository burugo/one-mcp (412 stars, last pushed 14d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,541 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.