AGENT SKILL

数据库封装层代码生成

generate-db-wrappers

为所有受支持的数据库引擎生成数据库封装层(wrapper)。

使用场景数据库管理
License 许可
MIT
所属仓库
kalbasit/ncps-test
最近更新
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 develop or after loading direnv.

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.go
  • pkg/database/wrapper_postgres.go
  • pkg/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.go interface.

04 同仓库更多 Skills

kalbasit
kalbasit/ncps-test

OpenSpec 变更验证

openspec-verify-change

验证实现是否与变更工件一致。当用户想要在归档前验证实现是否完整、正确且连贯时使用。

软件开发工程师工程变更管理
★ 0
kalbasit
kalbasit/ncps-test

OpenSpec 规格同步

openspec-sync-specs

将变更中的增量规格(delta spec)同步到主规格。当用户想要用增量规格中的变更更新主规格,而不归档该变更时使用。

软件开发工程师工程变更管理
★ 0
kalbasit
kalbasit/ncps-test

OpenSpec 变更提案

openspec-propose

一步生成所有工件,提出新的变更。当用户想要快速描述要构建的内容,并获得包含设计、规格和任务的完整提案以供实施时使用。

软件开发工程师工程变更管理
★ 0
kalbasit
kalbasit/ncps-test

启动 OpenSpec 新变更

openspec-new-change

使用实验性工件工作流启动新的 OpenSpec 变更。当用户想要以结构化的分步方式创建新功能、修复或修改时使用。

软件开发工程师工程变更管理
★ 0
kalbasit
kalbasit/ncps-test

OpenSpec 工件快速创建

openspec-ff-change

快速推进 OpenSpec 工件创建。当用户想要快速创建实现所需的全部工件,而无需逐个操作时使用。

软件开发工程师工程变更管理
★ 0
kalbasit
kalbasit/ncps-test

OpenSpec 需求探索

openspec-explore

进入探索模式——作为思考伙伴,帮助探索想法、排查问题并澄清需求。当用户想在变更之前或期间深入思考某事时使用。

软件开发工程师需求澄清与上下文补全
★ 0