重新启用 gskctl, 一个基于 dsl 的代码生成工具

sskycn 2026-08-04 00:56 1

为了确保写出来的代码一定是高效稳定的,我重新启用 gskctl 了。


用 AI 写模板,用它生成代码,好像还不错。


type UserRepository interface {
// @QueryRow("select * from User where Id = :id")
GetUser(ctx context.Context, id uint64) (User, error)

// @Query("select U.Id, U.Name, T.Name as TeamName from User as U left join Team as T where U.Active is true and (U.Name like :name or T.Name is null) order by U.Name limit :limit offset :offset")
ListUsers(ctx context.Context, name string, limit int, offset int) ([]ListUsersRow, error)

// @Create("insert into User (Id, Name, Active) values (:id, :name, true) on conflict (Id) do update set Name = excluded.Name returning *")
UpsertUser(ctx context.Context, id uint64, name string) (User, error)

// @Update("update User set Name = coalesce(:name, Name) where Id = :id returning Id, Name")
RenameUser(ctx context.Context, name string, id uint64) ([]RenameUserRow, error)

// @Delete("delete from User where Id = :id")
DeleteUser(ctx context.Context, id uint64) (sql.Result, error)
}
最新回复 (4)
  • vultr 08-04 14:45
    1
    你的 pro 不够用了吗?不够再买一个,公司报销。
  • sskycn 楼主 08-04 18:03
    2
    我给 gdkctl 实现了 LSP 和 MCP 接入,主要还是 AI 操作,token 使用量降了相当多。
  • sskycn 楼主 08-04 18:04
    3
    我给 gskctl 实现了 LSP 和 MCP 接入,主要还是 AI 操作,token 使用量降了相当多。
  • vultr 08-04 18:31
    4
    @sskycn 用不完额度,你们公司不扣绩效?
* 帖子来源V2EX
返回