agentsclimarketplace

Postgresql syntax

Skill saifoelloh/golang-best-practices-skill/postgresql-syntax

Production-ready Go code review skill for AI agents based on authoritative sources

Install
npx -y skills add saifoelloh/golang-best-practices-skill --skill postgresql-syntax

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 16 stars16 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

PostgreSQL SQL syntax review for Go/GORM projects. Use when writing or reviewing raw SQL used via db.Raw(), db.Exec(), or migrations. Covers placeholder style, reserved keyword quoting, RETURNING, ILIKE, JSONB operators, and type casting. Don't use for MySQL or SQLite.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

3.3 KB, as published. Nobody here has run it

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

PriorityCountFocus
Critical1Placeholder style mismatch
High4Identifier quoting, RETURNING, ILIKE, type casting
Medium4CTE 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:

This skillgolang-best-practices-skillRelationship
high-identifier-quotinghigh-gorm-identifier-quotingExpanded — more Postgres examples, full reserved word list
medium-select-redundancymedium-gorm-select-redundancyMirror — same rule, cross-referenced

Related Skills

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.