db

package
v0.0.0-...-51e95d8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddAccessibilityFeatureByReviewIDParams

type AddAccessibilityFeatureByReviewIDParams struct {
	CONCAT interface{}
	ID     string
}

type CreateFavoriteParams

type CreateFavoriteParams struct {
	UserID  sql.NullString
	PlaceID sql.NullString
}

type CreatePlaceParams

type CreatePlaceParams struct {
	ID               string
	GooglePlaceID    sql.NullString
	Name             sql.NullString
	FormattedAddress sql.NullString
	Lat              sql.NullFloat64
	Lng              sql.NullFloat64
	Icon             sql.NullString
	Types            json.RawMessage
	OpeningPeriods   json.RawMessage
	Photos           json.RawMessage
	Rating           sql.NullFloat64
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
}

type CreateReviewParams

type CreateReviewParams struct {
	ID                    string
	PlaceID               sql.NullString
	UserID                sql.NullString
	Content               sql.NullString
	Images                json.RawMessage
	Rating                sql.NullFloat64
	Reactions             json.RawMessage
	AccessibilityFeatures sql.NullString
	CreatedAt             sql.NullTime
	UpdatedAt             sql.NullTime
}

type CreateUserParams

type CreateUserParams struct {
	ID        string
	Email     string
	Avatar    sql.NullString
	Username  string
	Password  string
	Points    int32
	Missions  json.RawMessage
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteFavoriteByUserIdAndPlaceIdParams

type DeleteFavoriteByUserIdAndPlaceIdParams struct {
	UserID  sql.NullString
	PlaceID sql.NullString
}

type Favorite

type Favorite struct {
	PlaceID sql.NullString
	UserID  sql.NullString
}

type FindPlacesNearbyParams

type FindPlacesNearbyParams struct {
	POINT   float64
	POINT_2 float64
	Lat     sql.NullFloat64
}

type FindReviewsByPlaceIdParams

type FindReviewsByPlaceIdParams struct {
	PlaceID sql.NullString
	Limit   int32
	Offset  int32
}

type FindReviewsByUserIDParams

type FindReviewsByUserIDParams struct {
	UserID sql.NullString
	Limit  int32
	Offset int32
}

type Place

type Place struct {
	ID               string
	GooglePlaceID    sql.NullString
	Name             sql.NullString
	FormattedAddress sql.NullString
	Lat              sql.NullFloat64
	Lng              sql.NullFloat64
	Icon             sql.NullString
	Types            json.RawMessage
	OpeningPeriods   json.RawMessage
	Photos           json.RawMessage
	Rating           sql.NullFloat64
	CreatedAt        sql.NullTime
	UpdatedAt        sql.NullTime
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) AddAccessibilityFeatureByReviewID

func (q *Queries) AddAccessibilityFeatureByReviewID(ctx context.Context, arg AddAccessibilityFeatureByReviewIDParams) error

func (*Queries) CreateFavorite

func (q *Queries) CreateFavorite(ctx context.Context, arg CreateFavoriteParams) error

func (*Queries) CreatePlace

func (q *Queries) CreatePlace(ctx context.Context, arg CreatePlaceParams) error

func (*Queries) CreateReview

func (q *Queries) CreateReview(ctx context.Context, arg CreateReviewParams) error

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error

func (*Queries) DeleteFavoriteByUserIdAndPlaceId

func (q *Queries) DeleteFavoriteByUserIdAndPlaceId(ctx context.Context, arg DeleteFavoriteByUserIdAndPlaceIdParams) error

func (*Queries) DeletePlaceById

func (q *Queries) DeletePlaceById(ctx context.Context, id string) error

func (*Queries) DeleteReviewById

func (q *Queries) DeleteReviewById(ctx context.Context, id string) error

func (*Queries) DeleteUserById

func (q *Queries) DeleteUserById(ctx context.Context, id string) error

func (*Queries) FindFavoritesByUserId

func (q *Queries) FindFavoritesByUserId(ctx context.Context, userID sql.NullString) ([]sql.NullString, error)

func (*Queries) FindPlaceByGooglePlaceId

func (q *Queries) FindPlaceByGooglePlaceId(ctx context.Context, googlePlaceID sql.NullString) (Place, error)

func (*Queries) FindPlaceById

func (q *Queries) FindPlaceById(ctx context.Context, id string) (Place, error)

func (*Queries) FindPlacesByAccessibilityFeature

func (q *Queries) FindPlacesByAccessibilityFeature(ctx context.Context, findINSET string) ([]Place, error)

func (*Queries) FindPlacesNearby

func (q *Queries) FindPlacesNearby(ctx context.Context, arg FindPlacesNearbyParams) ([]Place, error)

func (*Queries) FindReviewById

func (q *Queries) FindReviewById(ctx context.Context, id string) (Review, error)

func (*Queries) FindReviewsByPlaceId

func (q *Queries) FindReviewsByPlaceId(ctx context.Context, arg FindReviewsByPlaceIdParams) ([]Review, error)

func (*Queries) FindReviewsByUserID

func (q *Queries) FindReviewsByUserID(ctx context.Context, arg FindReviewsByUserIDParams) ([]Review, error)

func (*Queries) FindUserByEmail

func (q *Queries) FindUserByEmail(ctx context.Context, email string) (User, error)

func (*Queries) FindUserById

func (q *Queries) FindUserById(ctx context.Context, id string) (User, error)

func (*Queries) GetAllUsers

func (q *Queries) GetAllUsers(ctx context.Context) ([]User, error)

func (*Queries) UpdatePlaceById

func (q *Queries) UpdatePlaceById(ctx context.Context, arg UpdatePlaceByIdParams) error

func (*Queries) UpdateReviewById

func (q *Queries) UpdateReviewById(ctx context.Context, arg UpdateReviewByIdParams) error

func (*Queries) UpdateUserById

func (q *Queries) UpdateUserById(ctx context.Context, arg UpdateUserByIdParams) error

func (*Queries) UpdateUserPointsByUserId

func (q *Queries) UpdateUserPointsByUserId(ctx context.Context, arg UpdateUserPointsByUserIdParams) error

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

type Review

type Review struct {
	ID                    string
	PlaceID               sql.NullString
	UserID                sql.NullString
	Content               sql.NullString
	Images                json.RawMessage
	Rating                sql.NullFloat64
	Reactions             json.RawMessage
	AccessibilityFeatures sql.NullString
	CreatedAt             sql.NullTime
	UpdatedAt             sql.NullTime
}

type UpdatePlaceByIdParams

type UpdatePlaceByIdParams struct {
	GooglePlaceID    sql.NullString
	Name             sql.NullString
	FormattedAddress sql.NullString
	Lat              sql.NullFloat64
	Lng              sql.NullFloat64
	Icon             sql.NullString
	Types            json.RawMessage
	OpeningPeriods   json.RawMessage
	Photos           json.RawMessage
	Rating           sql.NullFloat64
	UpdatedAt        sql.NullTime
	ID               string
}

type UpdateReviewByIdParams

type UpdateReviewByIdParams struct {
	Content               sql.NullString
	Images                json.RawMessage
	Rating                sql.NullFloat64
	Reactions             json.RawMessage
	AccessibilityFeatures sql.NullString
	UpdatedAt             sql.NullTime
	ID                    string
}

type UpdateUserByIdParams

type UpdateUserByIdParams struct {
	Email     string
	Avatar    sql.NullString
	Username  string
	Password  string
	Points    int32
	Missions  json.RawMessage
	UpdatedAt sql.NullTime
	ID        string
}

type UpdateUserPointsByUserIdParams

type UpdateUserPointsByUserIdParams struct {
	Points int32
	ID     string
}

type User

type User struct {
	ID        string
	Email     string
	Avatar    sql.NullString
	Username  string
	Password  string
	Points    int32
	Missions  json.RawMessage
	CreatedAt sql.NullTime
	UpdatedAt sql.NullTime
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL