1
0

models.go 1.6 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. // Venues can be either open or closed
  12. type Status string
  13. const (
  14. StatusOpen Status = "op!en"
  15. StatusClosed Status = "clo@sed"
  16. )
  17. func (e *Status) Scan(src interface{}) error {
  18. switch s := src.(type) {
  19. case []byte:
  20. *e = Status(s)
  21. case string:
  22. *e = Status(s)
  23. default:
  24. return fmt.Errorf("unsupported scan type for Status: %T", src)
  25. }
  26. return nil
  27. }
  28. type NullStatus struct {
  29. Status Status `json:"status"`
  30. Valid bool `json:"valid"` // Valid is true if Status is not NULL
  31. }
  32. // Scan implements the Scanner interface.
  33. func (ns *NullStatus) Scan(value interface{}) error {
  34. if value == nil {
  35. ns.Status, ns.Valid = "", false
  36. return nil
  37. }
  38. ns.Valid = true
  39. return ns.Status.Scan(value)
  40. }
  41. // Value implements the driver Valuer interface.
  42. func (ns NullStatus) Value() (driver.Value, error) {
  43. if !ns.Valid {
  44. return nil, nil
  45. }
  46. return string(ns.Status), nil
  47. }
  48. type City struct {
  49. Slug string `json:"slug"`
  50. Name string `json:"name"`
  51. }
  52. // Venues are places where muisc happens
  53. type Venue struct {
  54. ID int32 `json:"id"`
  55. Status Status `json:"status"`
  56. Statuses []Status `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 []string `json:"tags"`
  64. CreatedAt time.Time `json:"created_at"`
  65. }