010117 drizzle orm patterns
Drizzle ORM schema patterns — domain factories, prd_/sys_/tst_ prefixes, FK constraints, vector+HNSW, JSONB+GIN, raw SQL, and the as any bridge.From its SKILL.md
npx -y skills add natuleadan/skills --skill 010117-drizzle-orm-patternsAssembled 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 file declares
Copied from the file, not written here
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, 336 tokens by cl100k_base, 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
| Topic | File |
|---|---|
| Table naming, prefixes, timestamps | references/table-conventions.md |
| FK constraints and cascade rules | references/foreign-keys.md |
| Vector columns and HNSW indexes | references/vector-columns.md |
| JSONB columns and GIN indexes | references/jsonb-gin.md |
Raw SQL with sql\`` | references/raw-sql.md |
| Domain factory pattern | references/domain-factories.md |
Quick checklist
- Prefix tables:
prd_(prod),sys_(system),tst_(test) - Use
id()from_cuid.tsfor UUID PKs - Use
.references(()=>Table.id, {onDelete: "cascade"|"set null"})for FKs - Declare all
xxxIdcolumns as.references()— never leave implicit - Wrap domain logic in factory functions:
createXxxRepo(table) - Use
as anyto 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
timestampsspread (createdAt,updatedAt,deletedAt)
What ships with it: 9 files
10.0 KB alongside SKILL.md, 1 of them executable
evals/
- evals.json487 B
references/
- domain-factories.md1.8 KB
- foreign-keys.md1.0 KB
- jsonb-gin.md1.6 KB
- raw-sql.md1.3 KB
- table-conventions.md1.1 KB
- vector-columns.md1.4 KB
scripts/
- generate-schema.pyruns598 B
- metadata.json641 B