agentsclimarketplace

010117 drizzle orm patterns

Skill natuleadan/skills/skills/010117-drizzle-orm-patterns

Multi-domain agent skills collection for AI coding agents (Claude, Cursor, Copilot, OpenCode, and more). Covers programming, biology, cooking, and future domains. Installable via npx skills add.

Install
npx -y skills add natuleadan/skills --skill 010117-drizzle-orm-patterns

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

  • 2 stars2 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

Drizzle ORM schema patterns — domain factories, prd_/sys_/tst_ prefixes, FK constraints, vector+HNSW, JSONB+GIN, raw SQL, and the as any bridge.

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

1.5 KB, as published. Nobody here has run it

Drizzle ORM Patterns

When to use

When building PostgreSQL schemas with Drizzle ORM. Covers table conventions, constraints, vector search, and domain factories.

References

TopicFile
Table naming, prefixes, timestampsreferences/table-conventions.md
FK constraints and cascade rulesreferences/foreign-keys.md
Vector columns and HNSW indexesreferences/vector-columns.md
JSONB columns and GIN indexesreferences/jsonb-gin.md
Raw SQL with sql\``references/raw-sql.md
Domain factory patternreferences/domain-factories.md

Quick checklist

  • Prefix tables: prd_ (prod), sys_ (system), tst_ (test)
  • Use id() from _cuid.ts for UUID PKs
  • Use .references(()=>Table.id, {onDelete: "cascade"|"set null"}) for FKs
  • Declare all xxxId columns as .references() — never leave implicit
  • Wrap domain logic in factory functions: createXxxRepo(table)
  • Use as any to bridge Drizzle's complex types in factories
  • For vector search: vector({ dimensions: 384 }) + HNSW index
  • For JSONB search: jsonb() + GIN @> index
  • For timestamps: use the timestamps spread (createdAt, updatedAt, deletedAt)

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.