1
0

venue.sql 643 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* name: ListVenues :many */
  2. SELECT *
  3. FROM venue
  4. WHERE city = ?
  5. ORDER BY name;
  6. /* name: DeleteVenue :exec */
  7. DELETE FROM venue
  8. WHERE slug = ? AND slug = ?;
  9. /* name: GetVenue :one */
  10. SELECT *
  11. FROM venue
  12. WHERE slug = ? AND city = ?;
  13. /* name: CreateVenue :execresult */
  14. INSERT INTO venue (
  15. slug,
  16. name,
  17. city,
  18. created_at,
  19. spotify_playlist,
  20. status,
  21. statuses,
  22. tags
  23. ) VALUES (
  24. ?,
  25. ?,
  26. ?,
  27. NOW(),
  28. ?,
  29. ?,
  30. ?,
  31. ?
  32. );
  33. /* name: UpdateVenueName :exec */
  34. UPDATE venue
  35. SET name = ?
  36. WHERE slug = ?;
  37. /* name: VenueCountByCity :many */
  38. SELECT
  39. city,
  40. count(*)
  41. FROM venue
  42. GROUP BY 1
  43. ORDER BY 1;