models.go 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Code generated by sqlc. DO NOT EDIT.
  2. // versions:
  3. // sqlc v1.23.0
  4. package ondeck
  5. import (
  6. "database/sql"
  7. "database/sql/driver"
  8. "fmt"
  9. "time"
  10. )
  11. type VenueStatus string
  12. const (
  13. VenueStatusOpen VenueStatus = "open"
  14. VenueStatusClosed VenueStatus = "closed"
  15. )
  16. func (e *VenueStatus) Scan(src interface{}) error {
  17. switch s := src.(type) {
  18. case []byte:
  19. *e = VenueStatus(s)
  20. case string:
  21. *e = VenueStatus(s)
  22. default:
  23. return fmt.Errorf("unsupported scan type for VenueStatus: %T", src)
  24. }
  25. return nil
  26. }
  27. type NullVenueStatus struct {
  28. VenueStatus VenueStatus `json:"venue_status"`
  29. Valid bool `json:"valid"` // Valid is true if VenueStatus is not NULL
  30. }
  31. // Scan implements the Scanner interface.
  32. func (ns *NullVenueStatus) Scan(value interface{}) error {
  33. if value == nil {
  34. ns.VenueStatus, ns.Valid = "", false
  35. return nil
  36. }
  37. ns.Valid = true
  38. return ns.VenueStatus.Scan(value)
  39. }
  40. // Value implements the driver Valuer interface.
  41. func (ns NullVenueStatus) Value() (driver.Value, error) {
  42. if !ns.Valid {
  43. return nil, nil
  44. }
  45. return string(ns.VenueStatus), nil
  46. }
  47. type City struct {
  48. Slug string `json:"slug"`
  49. Name string `json:"name"`
  50. }
  51. // Venues are places where muisc happens
  52. type Venue struct {
  53. ID uint64 `json:"id"`
  54. // Venues can be either open or closed
  55. Status VenueStatus `json:"status"`
  56. Statuses sql.NullString `json:"statuses"`
  57. // This value appears in public URLs
  58. Slug string `json:"slug"`
  59. Name string `json:"name"`
  60. City string `json:"city"`
  61. SpotifyPlaylist string `json:"spotify_playlist"`
  62. SongkickID sql.NullString `json:"songkick_id"`
  63. Tags sql.NullString `json:"tags"`
  64. CreatedAt time.Time `json:"created_at"`
  65. }