queries

package
v0.0.0-...-08b4e76 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddIngredientToStepParams

type AddIngredientToStepParams struct {
	StepID        int64
	IngredientsID int64
	UnitID        int64
	Amount        pgtype.Numeric
	Note          string
}

type AddNewStepParams

type AddNewStepParams struct {
	RecipeID    int64
	Instruction string
	Time        pgtype.Interval
}

type AddRecipeParams

type AddRecipeParams struct {
	Name                string
	Description         string
	WorkingTime         pgtype.Interval
	WaitingTime         pgtype.Interval
	CreatedBy           int64
	Source              sql.NullString
	Servings            int32
	ServingsDescription string
}

type AddRecipeRow

type AddRecipeRow struct {
	ID        int64
	CreatedAt time.Time
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type DeleteIngredientFromStepParams

type DeleteIngredientFromStepParams struct {
	StepID        int64
	IngredientsID int64
}

type GetAllRecipesByNameRow

type GetAllRecipesByNameRow struct {
	ID   int64
	Name string
}

type GetStepsForRecipeByIDRow

type GetStepsForRecipeByIDRow struct {
	ID          int64
	Instruction string
	StepTime    pgtype.Interval
	Ingredients pgtype.JSONB
}

type GetTotalIngredientsForRecipeRow

type GetTotalIngredientsForRecipeRow struct {
	Name        string
	UnitName    sql.NullString
	TotalAmount int64
}

type Household

type Household struct {
	ID   int64
	Name string
}

type HouseholdUser

type HouseholdUser struct {
	HouseholdID int64
	UserID      int64
}

type Ingredient

type Ingredient struct {
	ID   int64
	Name string
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddDemoUser

func (q *Queries) AddDemoUser(ctx context.Context) (int64, error)

func (*Queries) AddIngredient

func (q *Queries) AddIngredient(ctx context.Context, name string) (int64, error)

func (*Queries) AddIngredientToStep

func (q *Queries) AddIngredientToStep(ctx context.Context, arg AddIngredientToStepParams) error

func (*Queries) AddNewStep

func (q *Queries) AddNewStep(ctx context.Context, arg AddNewStepParams) (int64, error)

func (*Queries) AddRecipe

func (q *Queries) AddRecipe(ctx context.Context, arg AddRecipeParams) (AddRecipeRow, error)

func (*Queries) AddUnit

func (q *Queries) AddUnit(ctx context.Context, name string) (int64, error)

func (*Queries) DeleteIngredientFromStep

func (q *Queries) DeleteIngredientFromStep(ctx context.Context, arg DeleteIngredientFromStepParams) error

func (*Queries) DeleteStepByID

func (q *Queries) DeleteStepByID(ctx context.Context, id int64) error

func (*Queries) GetAllIngredients

func (q *Queries) GetAllIngredients(ctx context.Context) ([]Ingredient, error)

func (*Queries) GetAllRecipesByName

func (q *Queries) GetAllRecipesByName(ctx context.Context) ([]GetAllRecipesByNameRow, error)

func (*Queries) GetAllUnits

func (q *Queries) GetAllUnits(ctx context.Context) ([]Unit, error)

func (*Queries) GetIngredientNameByID

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

func (*Queries) GetRecipeByID

func (q *Queries) GetRecipeByID(ctx context.Context, id int64) (Recipe, error)

func (*Queries) GetStepByID

func (q *Queries) GetStepByID(ctx context.Context, id int64) (Step, error)

func (*Queries) GetStepsForRecipeByID

func (q *Queries) GetStepsForRecipeByID(ctx context.Context, id int64) ([]GetStepsForRecipeByIDRow, error)

func (*Queries) GetTotalIngredientsForRecipe

func (q *Queries) GetTotalIngredientsForRecipe(ctx context.Context, id int64) ([]GetTotalIngredientsForRecipeRow, error)

func (*Queries) UpdateBasicRecipeInformation

func (q *Queries) UpdateBasicRecipeInformation(ctx context.Context, arg UpdateBasicRecipeInformationParams) error

func (*Queries) UpdateStepByID

func (q *Queries) UpdateStepByID(ctx context.Context, arg UpdateStepByIDParams) error

func (*Queries) WithTx

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

type Recipe

type Recipe struct {
	ID                  int64
	Name                string
	Description         string
	WorkingTime         pgtype.Interval
	WaitingTime         pgtype.Interval
	CreatedAt           time.Time
	UpdatedAt           sql.NullTime
	CreatedBy           int64
	Source              sql.NullString
	Servings            int32
	ServingsDescription string
}

type SchemaMigration

type SchemaMigration struct {
	Version string
}

type Step

type Step struct {
	ID          int64
	RecipeID    int64
	SortOrder   int32
	Instruction string
	Time        pgtype.Interval
}

type StepIngredient

type StepIngredient struct {
	StepID        int64
	IngredientsID int64
	UnitID        sql.NullInt64
	Amount        pgtype.Numeric
	Note          string
}

type Unit

type Unit struct {
	ID   int64
	Name string
}

type UpdateBasicRecipeInformationParams

type UpdateBasicRecipeInformationParams struct {
	Name                string
	Servings            int32
	Description         string
	ServingsDescription string
	ID                  int64
}

type UpdateStepByIDParams

type UpdateStepByIDParams struct {
	Instruction string
	Time        pgtype.Interval
	ID          int64
}

type User

type User struct {
	ID                    int64
	Name                  string
	Email                 string
	PasswordHash          string
	PasswordHashAlgorithm string
	IsActivated           bool
	IsSuperuser           bool
}

Jump to

Keyboard shortcuts

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