AGENT SKILL

generate-db-wrappers

Generate database wrappers for all supported database engines

使用场景后端与接口
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