数据库封装层代码生成
generate-db-wrappers
为所有受支持的数据库引擎生成数据库封装层(wrapper)。
- License 许可
- MIT
- 最近更新
- 2026-09-30
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- description
- Generate database wrappers for all supported database engines
02 资源文件 6
03 SKILL.md 正文
Generate Database Wrappers
This workflow guides you through generating the database wrappers for SQLite, PostgreSQL, and MySQL. These wrappers provide a common interface for different database backends.
Prerequisites
- Nix environment: This project uses Nix for its development environment. You should run the following steps within
nix developor after loadingdirenv.
Workflow Steps
1. Generate Wrappers
Run sqlc generate followed by the go generate command for the pkg/database package. Both should be run within the Nix environment.
// turbo
nix develop --command bash -c "sqlc generate && go generate ./pkg/database"
2. Verify Generated Files
Ensure that the following files have been updated:
pkg/database/wrapper_sqlite.gopkg/database/wrapper_postgres.gopkg/database/wrapper_mysql.go
3. Lint and Format
After generating the wrappers, run the linting workflow to ensure the generated code is properly formatted and passes quality checks.
// turbo
nix develop --command golangci-lint run --fix
nix fmt
[!IMPORTANT] Do NOT edit these files manually. They are overwritten every time the generation tool is run. If you need to fix lint errors or change the logic, modify the generation tool or the
querier.gointerface.
04 同仓库更多 Skills
OpenSpec 变更验证
openspec-verify-change
验证实现是否与变更工件一致。当用户想要在归档前验证实现是否完整、正确且连贯时使用。
OpenSpec 规格同步
openspec-sync-specs
将变更中的增量规格(delta spec)同步到主规格。当用户想要用增量规格中的变更更新主规格,而不归档该变更时使用。
OpenSpec 变更提案
openspec-propose
一步生成所有工件,提出新的变更。当用户想要快速描述要构建的内容,并获得包含设计、规格和任务的完整提案以供实施时使用。
启动 OpenSpec 新变更
openspec-new-change
使用实验性工件工作流启动新的 OpenSpec 变更。当用户想要以结构化的分步方式创建新功能、修复或修改时使用。
OpenSpec 工件快速创建
openspec-ff-change
快速推进 OpenSpec 工件创建。当用户想要快速创建实现所需的全部工件,而无需逐个操作时使用。
OpenSpec 需求探索
openspec-explore
进入探索模式——作为思考伙伴,帮助探索想法、排查问题并澄清需求。当用户想在变更之前或期间深入思考某事时使用。