sqlc demo:SQLC演示和进行迁移 源码
sqlc-demo 使用sqlc和go-migrate的简单演示 设置本地环境 make stack-up 创建查询的示例 -- name: GetAuthor :one SELECT * FROM authors WHERE id = $ 1 LIMIT 1 ; -- name: ListAuthors :many SELECT * FROM authors ORDER BY name; -- name: CreateAuthor :one INSERT INTO authors ( name, bio, reference ) VALUES ( $ 1 , $ 2 , $ 3 ) RETURNING * ; -- name: DeleteAuthor :exec DELETE FROM authors WHERE id = $ 1 ; 示范 端到端的可跟踪演示。 make
用户评论