database-postgresql
/database-postgresql
Stosuje standardy PostgreSQL dla migracji, indeksów, transakcji i granic ORM przy edycji encji, schematu Prisma, migracji, RLS i optymalizacji zapytań.
- Autor
- HoangNguyen0403 ↗
- Repozytorium
- agent-skills-standard ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 22.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 7
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Stosuje standardy PostgreSQL dla migracji, indeksów, transakcji i granic ORM przy edycji encji, schematu Prisma, migracji, RLS i optymalizacji zapytań.
Oryginalny opis (EN)
Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.
Jak działa
- Priority: P0 (CRITICAL)
- Rules
- Verify
- Anti-Patterns
- References
Podgląd SKILL.md
---
name: database-postgresql
description: Apply PostgreSQL standards for migrations, indexing, transactions, and ORM boundaries. Use when editing entities, Prisma schema, migrations, RLS, or query-performance work for PostgreSQL.
metadata:
triggers:
files:
- "**/*.entity.ts"
- "prisma/schema.prisma"
- "**/migrations/*.sql"
keywords:
- TypeOrmModule
- PrismaService
- PostgresModule
upstream:
- name: postgresql
source: github
repo: postgres/postgres
pinned: "17"
tag_pattern: "^REL_(\\d+)_(\\d+)$"
reviewed: "2026-06-17"
---
# PostgreSQL Database Standards
## **Priority: P0 (CRITICAL)**
## Rules
- Keep PostgreSQL choices driven by real read/write paths.
- Use explicit migrations; never rely on `synchronize: true` in production.
- Treat RLS, constraints, and indexes as first-class schema behavior; use `queryRunner.query()` when raw migration SQL is required.
- Enable RLS explicitly in a migration (`ALTER TABLE <table> ENABLE ROW LEVEL SECURITY`) and create tenant policies before application rollout.
- Put multi-step consistency inside one transaction boundary.
## Verify
- [ ] Destructive schema change uses expand -> backfill -> contract rollout.
- [ ] Query shape has matching indexes for filter, join, and sort paths.
- [ ] Pagination strategy is explicit.
- [ ] Transaction boundary matches one business action.
- [ ] RLS or tenant predicates are supported by indexes.
## 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 query/view layer.
- **No synchronize in production**: Always run explicit migrations; `synchronize: true` destructive.
- **No blind index sprawl**: each index needs a query owner.
## References
- [Framework Map](../references/framework-map.md)
- [Implementation Examples](references/implementation.md)
- [SQL Gotchas (UPDATE FROM)](references/sql-gotchas.md)
Pliki w paczce (7)
- SKILL.md 2 KB
- evals/evals.json 2 KB
- references/anti-patterns.md 2 KB
- references/best-practices.md 4 KB
- references/checklist.md 2 KB
- references/implementation.md 1 KB
- references/sql-gotchas.md 2 KB
Wersje
W bazie nie ma innych skilli o nazwie database-postgresql.
Migawka bazy z 28.10.2026 · wersja paczki 690da2513dd5 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100prisma-workflow
Zbiera dobre praktyki Prisma ORM dla PostgreSQL: projektowanie schematu, migracje, seedowanie i optymalizację zapytań. - 100prisma-expert
Dostarcza wzorce Prisma ORM dla projektu schematu, migracji, optymalizacji zapytań i modelowania relacji, przy pracy z plikami schema.prisma. - 100prisma
Stosuje dobre praktyki TypeScript i Prisma ORM dla projektu schematu, typowanych zapytań, migracji i obsługi błędów oraz diagnozowania wydajności zapytań. - 95database-fundamentals
Sprawdza projekt schematu, zapytania SQL i wzorce ORM, w tym migracje, N+1 i indeksy, w pracy z Prisma, MongoDB i PostgreSQL. - 100database-migrations
Opisuje dobre praktyki migracji baz danych dla zmian schematu, migracji danych, wycofań i wdrożeń bez przestojów w PostgreSQL, MySQL i popularnych ORM. - 100prisma-orm-patterns-and-migrations
Stosuje dobre praktyki Prisma ORM: projekt schematu, optymalizacja zapytań, unikanie problemu N+1, migracje bez przestojów, pule połączeń i modelowanie danych wielodzierżawczych.