golang-examples/example-sqlc/authors/mysql/query.sql

19 lines
299 B
SQL

/* name: GetAuthor :one */
SELECT * FROM authors
WHERE id = ? LIMIT 1;
/* name: ListAuthors :many */
SELECT * FROM authors
ORDER BY name;
/* name: CreateAuthor :execresult */
INSERT INTO authors (
name, bio
) VALUES (
?, ?
);
/* name: DeleteAuthor :exec */
DELETE FROM authors
WHERE id = ?;