1
0

city.sql 413 B

1234567891011121314151617181920212223242526
  1. -- name: ListCities :many
  2. SELECT *
  3. FROM city
  4. ORDER BY name;
  5. -- name: GetCity :one
  6. SELECT *
  7. FROM city
  8. WHERE slug = $1;
  9. -- name: CreateCity :one
  10. -- Create a new city. The slug must be unique.
  11. -- This is the second line of the comment
  12. -- This is the third line
  13. INSERT INTO city (
  14. name,
  15. slug
  16. ) VALUES (
  17. $1,
  18. $2
  19. ) RETURNING *;
  20. -- name: UpdateCityName :exec
  21. UPDATE city
  22. SET name = $2
  23. WHERE slug = $1;