AGENT SKILL
postgresql-exposed-orm
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-14
- Stars
- ★ 0
- Forks
- 0
02 资源文件 6
- 参考文档manifest.yaml511 B
- 参考文档references/hikaricp-config.md1.7 KB
- 参考文档references/migrations-flyway.md2.0 KB
- 参考文档references/query-patterns.md2.8 KB
- 参考文档references/table-definitions.md2.6 KB
- 参考文档references/transactions.md3.3 KB
03 SKILL.md 正文
PostgreSQL with Kotlin Exposed ORM
Workflow
- Identify the task area from the user's request.
- Match it to the Decision Table below.
- Read
references/<chosen>.mdusing theReadtool. - Apply patterns from that reference, combined with the Always-Active Rules below.
Decision Table
| If the task involves… | Read first |
|---|---|
| Table design, column types, indexes, composite keys, foreign keys | references/table-definitions.md |
| SELECT, JOIN, WHERE, GROUP BY, batchInsert, DSL vs DAO, N+1 | references/query-patterns.md |
transaction{}, newSuspendedTransaction, rollback, retry on deadlock |
references/transactions.md |
Flyway SQL migrations, naming convention, generateMigration task |
references/migrations-flyway.md |
| HikariCP pool sizing, timeouts, Neon/cloud config | references/hikaricp-config.md |
Always-Active Rules
- Always use
safeDbQuery { }— never baretransaction { }or a hand-rolledResultContainer.catching { transaction { } }. safeDbQuerylives indata/db/DatabaseFactory.ktand is the only DB entry point — it doeswithContext(Dispatchers.IO)+transaction { }+ResultContainer.catchingitself.- Only
DatabaseFactory.ktmay useDispatchers.IO. - DDL changes require a Flyway migration via
./gradlew generateMigration— never hand-edit applied files.
Output Format
When reviewing or designing DB code:
- Schema assessment — table structure, index coverage, constraint correctness
- Query analysis — N+1 risks, missing indexes, transaction boundaries
- Migration note — if DDL changes are needed, generate via
./gradlew generateMigration - Code issues — violations of
safeDbQueryrule or layer boundary (data → domain)
Do NOT
- Do NOT load all reference files at once — pick exactly one per the Decision Table.
- Do NOT bypass
safeDbQueryby wrappingtransaction {}inResultContainer.catching {}manually. - Do NOT use bare
transaction {}directly in repositorydata/layer code. - Do NOT edit a Flyway migration file that has already been applied to any database.
- Do NOT use
Dispatchers.IOoutside ofDatabaseFactory.kt.
Error Handling
- If the task type does not match any Decision Table row, ask the user to clarify before proceeding.
- If a reference file is missing, STOP and report the expected path.
Related Skills
database-optimizer— query performance, index design, EXPLAIN ANALYZEkotlin-specialist— Kotlin coroutines and dispatcher rules that apply in DB contextunit-testing-kotlin— how to test repositories with MockImpl (no live DB in unit tests)
Example Invocation
- User: "Add a unique index to the Members table" → load
references/table-definitions.md, apply the index pattern. - User: "Why is my query slow?" → load
references/query-patterns.md, check N+1 and missing indexes.
04 同仓库更多 Skills
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
inline-frontmatter-skill
Hand-authored description that already lives in the body and must not be double-wrapped.
★ 0
universal-skill
暂无简介
★ 0
notion-skill
暂无简介
★ 0
write-a-skill
暂无简介
★ 0