gorm-sql-postgresql-syntax

gorm-sql-postgresql-syntax is a skill for Claude Code, Codex from saifoelloh/golang-best-practices-skill. It costs 68 tokens per session (879 once invoked), scanned A, original, MIT.

A review guide for PostgreSQL SQL used from Go programs with GORM, a Go library for working with databases. It covers PostgreSQL-specific syntax and common patterns in queries and migrations.

In plain words
What is it for?
Use it when writing or reviewing raw SQL, migrations, JSONB or UUID queries, case-insensitive searches, generated-value queries, common table expressions, or window functions.
Why use it?
It helps catch database errors caused by incorrect placeholders, quoting, type conversions, or PostgreSQL features before the code runs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when writing or reviewing raw SQL, migrations, JSONB or UUID queries, case-insensitive searches, generated-value queries, common table expressions, or window functions.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/saifoelloh/golang-best-practices-skill/postgresql-syntax
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.

Any agent
npx skills add saifoelloh/golang-best-practices-skill --skill postgresql-syntax
Clone the repo
git clone --depth 1 https://github.com/saifoelloh/golang-best-practices-skill

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gorm-sql-postgresql-syntax

README.md
[![agentmods](https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax/github.svg)](https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax)
Your own site
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gorm-sql-postgresql-syntax

Your own site · 80×15
<a href="https://agentmods.dev/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax"><img src="https://agentmods.dev/badge/skills/saifoelloh/golang-best-practices-skill/postgresql-syntax.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00068 $0.00879
Opus 5 $0.00034 $0.00439
Sonnet 5 $0.00014 $0.00176
Haiku 4.5 $0.00007 $0.00088

Measured 10d ago against content hash 686be735e48c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

gorm-sql-postgresql-syntax 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 10d ago.

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.

postgresql-syntax/SKILL.md · 77 lines

How it starts

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

PostgreSQL Syntax

Expert-level review of raw PostgreSQL SQL syntax in GORM/Go projects. Ensures correct Postgres-specific usage, idiomatic SQL, and avoids common runtime errors.

When to Apply

Use this skill when:

  • Writing raw SQL in db.Raw(), db.Exec(), or migration files
  • Debugging syntax error or operator does not exist PostgreSQL errors
  • Reviewing SQL expressions involving JSONB, UUID, timestamps, or reserved keywords
  • Using RETURNING, CTEs, window functions, or ILIKE

Rule Categories

Priority Count Focus
Critical 1 Placeholder style mismatch
High 4 Identifier quoting, RETURNING, ILIKE, type casting
Medium 4 CTE readability, JSONB operators, INTERVAL, select redundancy

Rules Covered (9 total)

Critical Issues (1)

  • critical-placeholder-style — Use ? with GORM, $N only with pgx/pq directly

High-Impact Patterns (4)

  • high-identifier-quoting — Quote reserved keywords (order, user, group) in raw SQL
  • high-returning-clause — Use RETURNING for generated values after INSERT/UPDATE
  • high-ilike-search — Use ILIKE for case-insensitive search, not LOWER(col) LIKE
  • high-explicit-cast — Cast types explicitly (::uuid, ::bigint) to avoid operator does not exist

Medium Improvements (4)

  • medium-cte-readability — Use CTEs instead of nested subqueries for complex queries
  • medium-jsonb-operators — Use correct @>, ->>, -> operators for JSONB queries
  • medium-interval-arithmetic — Use INTERVAL for date math, not manual second calculations
  • medium-select-redundancy — Don't manually quote plain column names in .Select() (GORM handles it)

Trigger Phrases

  • "Check this raw SQL"
  • "db.Raw / db.Exec"
  • "SQL syntax error"
  • "operator does not exist"
  • "reserved keyword"
  • "JSONB query"
  • "PostgreSQL compatibility"

Cross-Reference with golang-best-practices-skill

Two rules in this skill directly extend rules from the companion database-repository skill in golang-best-practices-skill:

Read the full file on GitHub · 77 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. 10d ago First seen · 77 lines · 68 tokens per session scan A 686be735e48c

Subscribe to this mod's changes

gorm-sql-postgresql-syntax is a skill published in the GitHub repository saifoelloh/golang-best-practices-skill (15 stars, last pushed 6mo ago), licensed MIT. It adds 68 tokens to every session and 879 once invoked, about $0.0003 per session on Opus 5. 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.

Related

Other skills, from other repositories

go-add-migration

Create properly named PostgreSQL migration files for GOB microservices.

JotJunior/cstk · 17 tokens

encore-go-database

Work with PostgreSQL in Encore Go using sqldb.NewDatabase from encore.dev/storage/sqldb — schema migrations and SQL queries.

encoredev/skills · 37 tokens

mfd

A Go code generator that reads XML descriptions of a PostgreSQL schema and creates models, repositories, services, and test helpers. It is used through project Makefile commands.

vmkteam/claude-plugins · 67 tokens

golang-database

Comprehensive guide for Go database access. Covers parameterized queries, struct scanning, NULLable column handling, error patterns, transactions, isolation levels, SELECT FOR UPDATE, connection pool, batch processing, context propagation, and migration tooling. Use this skill whenever writing, reviewing, or debugging…

emilioforrer/go-stack · 116 tokens

golang-samber-hot

In-memory caching in Golang using samber/hot — eviction algorithms (LRU, LFU, TinyLFU, W-TinyLFU, S3FIFO, ARC, TwoQueue, SIEVE, FIFO), TTL, cache loaders, sharding, stale-while-revalidate, missing key caching, and Prometheus metrics. Apply when using or adopting samber/hot, when the codebase imports…

emilioforrer/go-stack · 122 tokens

azure-resource-manager-postgresql-dotnet

Azure PostgreSQL Flexible Server SDK for .NET. Database management for PostgreSQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "PostgreSQL", "PostgreSqlFlexibleServer", "PostgreSQL Flexible Server", "Azure Database for…

microsoft/skills · 97 tokens