-- name: GetCountry :one
SELECT * FROM countries
WHERE id = ? LIMIT 1;

-- name: ListCountries :many
SELECT * FROM countries
ORDER BY name
LIMIT ? OFFSET ?;

-- name: CreateCountry :execresult
INSERT INTO countries (name) VALUES (?);

-- name: UpdateCountry :exec
UPDATE countries SET name = ? WHERE id = ?;

-- name: DeleteCountry :exec
DELETE FROM countries WHERE id = ?;

-- name: SearchCountriesByName :many
SELECT * FROM countries
WHERE name LIKE CONCAT('%', ?, '%')
ORDER BY name
LIMIT 10;