agentsclimarketplace

Database postgresql

Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/database-postgresql

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.

Install
npx -y skills add ComeOnOliver/skillshub --skill database-postgresql

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

What its author says it does

Copied from the file, not written here

Data access patterns, scaling, migrations, and ORM selection for PostgreSQL. (triggers: **/*.entity.ts, prisma/schema.prisma, **/migrations/*.sql, TypeOrmModule, PrismaService, PostgresModule)

SKILL.md

1.6 KB, as published. Nobody here has run it

PostgreSQL Database Standards

Priority: P0 (FOUNDATIONAL)

Integration patterns and ORM standards for PostgreSQL applications.

Patterns & Architecture

  • Repository Pattern: Isolate database logic. Use @InjectRepository() or PrismaService.
  • Relationship Integrity: Avoid redundant raw ID columns. Favor relation properties.

Migrations (Strict Rules)

  • NEVER use synchronize: true in production.
  • Generation: Modify .entity.ts -> run pnpm migration:generate.
  • Zero-Downtime: Use Expand-Contract pattern (Add -> Backfill -> Drop) for destructive changes.
  • RLS: typeorm migration:generate cannot detect Row-Level Security. Use raw queryRunner.query() SQL for RLS.

Performance & Gotchas

  • Pagination: Mandatory. Use limit/offset or cursor-based pagination.
  • Indexing: Define indexes in code for frequently filtered columns. RLS columns MUST be indexed.
  • Transactions: Use QueryRunner or $transaction for multi-step mutations.

Anti-Patterns

  • No N+1 queries: Use query builders or eager-load relations instead of lazy-loading in loops.
  • No heavy RLS joins: Keep RLS predicates simple; move complex logic to the query/view layer.
  • No synchronize in production: Always run explicit migrations; synchronize: true is destructive.

References

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.