db

package
v0.0.0-...-089add1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmbedMigrations embed.FS

Functions

This section is empty.

Types

type AddGoalToTileParams

type AddGoalToTileParams struct {
	TileID      int32
	GoalTitle   string
	TargetValue int32
}

type Bingo

type Bingo struct {
	ID                int32
	Title             string
	Validfrom         pgtype.Timestamp
	Validto           pgtype.Timestamp
	Rows              int32
	Cols              int32
	Description       string
	Codephrase        string
	Active            bool
	SubmissionsClosed bool
	LeaderboardPublic bool
}

type BingosLogin

type BingosLogin struct {
	BingoID int32
	LoginID int32
}

type CreateBingoParams

type CreateBingoParams struct {
	Title       string
	Validfrom   pgtype.Timestamp
	Validto     pgtype.Timestamp
	Rows        int32
	Cols        int32
	Description string
	Active      bool
	Codephrase  string
}

type CreateBingoParticipantParams

type CreateBingoParticipantParams struct {
	LoginID int32
	BingoID int32
}

type CreateLoginParams

type CreateLoginParams struct {
	Password     string
	Name         string
	IsManagement bool
}

type CreateSubmissionCommentParams

type CreateSubmissionCommentParams struct {
	SubmissionID int32
	LoginID      int32
	Comment      string
}

type CreateSubmissionImageParams

type CreateSubmissionImageParams struct {
	Path         string
	SubmissionID int32
}

type CreateSubmissionParams

type CreateSubmissionParams struct {
	LoginID int32
	TileID  int32
	State   Submissionstate
}

type CreateTemplateTileParams

type CreateTemplateTileParams struct {
	Title              string
	Imagepath          string
	Description        string
	Weight             int32
	SecondaryImagePath string
}

type CreateTileParams

type CreateTileParams struct {
	Title              string
	Imagepath          string
	Description        string
	BingoID            int32
	Weight             int32
	SecondaryImagePath string
}

type CreateTilesParams

type CreateTilesParams struct {
	Title              string
	Imagepath          string
	Description        string
	BingoID            int32
	Weight             int32
	SecondaryImagePath string
}

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
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type DeleteBingoParticipantParams

type DeleteBingoParticipantParams struct {
	LoginID int32
	BingoID int32
}

type GetBingoLeaderboardRow

type GetBingoLeaderboardRow struct {
	Name   string
	Points int64
}

type GetBingoParticipantsRow

type GetBingoParticipantsRow struct {
	ID   int32
	Name string
}

type GetCommentsForSubmissionRow

type GetCommentsForSubmissionRow struct {
	SubmissionID   int32
	Managementuser string
	Comment        string
	CreatedAt      pgtype.Timestamptz
}

type GetPossibleBingoParticipantsRow

type GetPossibleBingoParticipantsRow struct {
	ID   int32
	Name string
}

type GetStatsByLoginAndBingoParams

type GetStatsByLoginAndBingoParams struct {
	LoginID int32
	BingoID int32
}

type GetStatsByLoginAndBingoRow

type GetStatsByLoginAndBingoRow struct {
	Submitted   int64
	NeedsAction int64
	Accepted    int64
}

type GetSubmissionIdForTileAndLoginParams

type GetSubmissionIdForTileAndLoginParams struct {
	TileID  int32
	LoginID int32
}

type GetSubmissionsByBingoAndLoginParams

type GetSubmissionsByBingoAndLoginParams struct {
	LoginID int32
	BingoID int32
}

type GetSubmissionsByBingoAndLoginRow

type GetSubmissionsByBingoAndLoginRow struct {
	BingoID    int32
	Submission Submission
	Tile       Tile
}

type GetSubmissionsForTileAndLoginParams

type GetSubmissionsForTileAndLoginParams struct {
	TileID  int32
	LoginID int32
}

type GetSubmissionsForTileAndLoginRow

type GetSubmissionsForTileAndLoginRow struct {
	Submission Submission
	Login      Login
}

type GetSubmissionsForTileRow

type GetSubmissionsForTileRow struct {
	Submission Submission
	Login      Login
}

type GoalProgress

type GoalProgress struct {
	ID                  int32
	GoalID              int32
	LoginID             int32
	CurrentGoalProgress int32
}

type Login

type Login struct {
	ID           int32
	Name         string
	IsManagement bool
	Password     string
}

type NullSubmissionstate

type NullSubmissionstate struct {
	Submissionstate Submissionstate
	Valid           bool // Valid is true if Submissionstate is not NULL
}

func (*NullSubmissionstate) Scan

func (ns *NullSubmissionstate) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullSubmissionstate) Value

func (ns NullSubmissionstate) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddGoalToTile

func (q *Queries) AddGoalToTile(ctx context.Context, arg AddGoalToTileParams) error

func (*Queries) CreateBingo

func (q *Queries) CreateBingo(ctx context.Context, arg CreateBingoParams) (Bingo, error)

func (*Queries) CreateBingoParticipant

func (q *Queries) CreateBingoParticipant(ctx context.Context, arg CreateBingoParticipantParams) error

func (*Queries) CreateLogin

func (q *Queries) CreateLogin(ctx context.Context, arg CreateLoginParams) error

func (*Queries) CreateSubmission

func (q *Queries) CreateSubmission(ctx context.Context, arg CreateSubmissionParams) (Submission, error)

func (*Queries) CreateSubmissionComment

func (q *Queries) CreateSubmissionComment(ctx context.Context, arg CreateSubmissionCommentParams) error

func (*Queries) CreateSubmissionImage

func (q *Queries) CreateSubmissionImage(ctx context.Context, arg CreateSubmissionImageParams) error

func (*Queries) CreateTemplateTile

func (q *Queries) CreateTemplateTile(ctx context.Context, arg CreateTemplateTileParams) (TemplateTile, error)

func (*Queries) CreateTile

func (q *Queries) CreateTile(ctx context.Context, arg CreateTileParams) (Tile, error)

func (*Queries) CreateTiles

func (q *Queries) CreateTiles(ctx context.Context, arg []CreateTilesParams) (int64, error)

func (*Queries) DeleteBingoById

func (q *Queries) DeleteBingoById(ctx context.Context, id int32) error

func (*Queries) DeleteBingoParticipant

func (q *Queries) DeleteBingoParticipant(ctx context.Context, arg DeleteBingoParticipantParams) error

func (*Queries) DeleteLogin

func (q *Queries) DeleteLogin(ctx context.Context, id int32) error

func (*Queries) DeleteSubmissionById

func (q *Queries) DeleteSubmissionById(ctx context.Context, id int32) error

func (*Queries) DeleteTemplateById

func (q *Queries) DeleteTemplateById(ctx context.Context, id int32) error

func (*Queries) GetAllLogins

func (q *Queries) GetAllLogins(ctx context.Context) ([]Login, error)

func (*Queries) GetBingoById

func (q *Queries) GetBingoById(ctx context.Context, id int32) (Bingo, error)

func (*Queries) GetBingoLeaderboard

func (q *Queries) GetBingoLeaderboard(ctx context.Context, bingoID int32) ([]GetBingoLeaderboardRow, error)

func (*Queries) GetBingoParticipants

func (q *Queries) GetBingoParticipants(ctx context.Context, bingoID int32) ([]GetBingoParticipantsRow, error)

func (*Queries) GetBingos

func (q *Queries) GetBingos(ctx context.Context) ([]Bingo, error)

func (*Queries) GetBingosForLogin

func (q *Queries) GetBingosForLogin(ctx context.Context, id int32) ([]Bingo, error)

func (*Queries) GetCommentsForSubmission

func (q *Queries) GetCommentsForSubmission(ctx context.Context, submissionID int32) ([]GetCommentsForSubmissionRow, error)

func (*Queries) GetImagesForSubmission

func (q *Queries) GetImagesForSubmission(ctx context.Context, submissionID int32) ([]string, error)

func (*Queries) GetLoginById

func (q *Queries) GetLoginById(ctx context.Context, id int32) (Login, error)

func (*Queries) GetLoginByName

func (q *Queries) GetLoginByName(ctx context.Context, name string) (Login, error)

func (*Queries) GetPossibleBingoParticipants

func (q *Queries) GetPossibleBingoParticipants(ctx context.Context, bingoID int32) ([]GetPossibleBingoParticipantsRow, error)

func (*Queries) GetRandomTemplates

func (q *Queries) GetRandomTemplates(ctx context.Context, dollar_1 int32) ([]TemplateTile, error)

func (*Queries) GetStatsByLoginAndBingo

func (q *Queries) GetStatsByLoginAndBingo(ctx context.Context, arg GetStatsByLoginAndBingoParams) (GetStatsByLoginAndBingoRow, error)

func (*Queries) GetSubmissionById

func (q *Queries) GetSubmissionById(ctx context.Context, id int32) (Submission, error)

func (*Queries) GetSubmissionClosedStatusForBingo

func (q *Queries) GetSubmissionClosedStatusForBingo(ctx context.Context, id int32) (bool, error)

func (*Queries) GetSubmissionIdForTileAndLogin

func (q *Queries) GetSubmissionIdForTileAndLogin(ctx context.Context, arg GetSubmissionIdForTileAndLoginParams) (int32, error)

func (*Queries) GetSubmissionsForTile

func (q *Queries) GetSubmissionsForTile(ctx context.Context, tileID int32) ([]GetSubmissionsForTileRow, error)

func (*Queries) GetTemplateImagePath

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

func (*Queries) GetTemplateTiles

func (q *Queries) GetTemplateTiles(ctx context.Context) ([]TemplateTile, error)

func (*Queries) GetTileById

func (q *Queries) GetTileById(ctx context.Context, id int32) (Tile, error)

func (*Queries) GetTilesForBingo

func (q *Queries) GetTilesForBingo(ctx context.Context, bingoID int32) ([]Tile, error)

func (*Queries) MakeUserManagement

func (q *Queries) MakeUserManagement(ctx context.Context, id int32) error

func (*Queries) ToggleBingoState

func (q *Queries) ToggleBingoState(ctx context.Context, id int32) (bool, error)

func (*Queries) ToggleLeaderboardPublic

func (q *Queries) ToggleLeaderboardPublic(ctx context.Context, id int32) (bool, error)

func (*Queries) ToggleSubmissionsClosed

func (q *Queries) ToggleSubmissionsClosed(ctx context.Context, id int32) (bool, error)

func (*Queries) UpdateLoginPassword

func (q *Queries) UpdateLoginPassword(ctx context.Context, arg UpdateLoginPasswordParams) (Login, error)

func (*Queries) UpdateSubmissionState

func (q *Queries) UpdateSubmissionState(ctx context.Context, arg UpdateSubmissionStateParams) (Submission, error)

func (*Queries) UpdateTile

func (q *Queries) UpdateTile(ctx context.Context, arg UpdateTileParams) (Tile, error)

func (*Queries) WithTx

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

type Submission

type Submission struct {
	ID      int32
	LoginID int32
	TileID  int32
	Date    pgtype.Timestamp
	State   Submissionstate
}

type SubmissionComment

type SubmissionComment struct {
	ID           int32
	Comment      string
	SubmissionID int32
	CreatedAt    pgtype.Timestamptz
	LoginID      int32
}

type SubmissionImage

type SubmissionImage struct {
	ID           int32
	Path         string
	SubmissionID int32
	CreatedAt    pgtype.Timestamp
}

type Submissionstate

type Submissionstate string
const (
	SubmissionstateSubmitted      Submissionstate = "Submitted"
	SubmissionstateActionRequired Submissionstate = "ActionRequired"
	SubmissionstateAccepted       Submissionstate = "Accepted"
)

func (*Submissionstate) Scan

func (e *Submissionstate) Scan(src interface{}) error

type TemplateTile

type TemplateTile struct {
	ID                 int32
	Title              string
	Imagepath          string
	Description        string
	Weight             int32
	SecondaryImagePath string
}

type Tile

type Tile struct {
	ID                 int32
	Title              string
	Imagepath          string
	Description        string
	BingoID            int32
	Weight             int32
	SecondaryImagePath string
}

type TileGoal

type TileGoal struct {
	ID          int32
	TileID      int32
	GoalTitle   string
	TargetValue int32
}

type UpdateLoginPasswordParams

type UpdateLoginPasswordParams struct {
	ID       int32
	Password string
}

type UpdateSubmissionStateParams

type UpdateSubmissionStateParams struct {
	ID    int32
	State Submissionstate
}

type UpdateTileParams

type UpdateTileParams struct {
	ID                 int32
	Title              string
	Imagepath          string
	Description        string
	Weight             int32
	SecondaryImagePath string
}

Jump to

Keyboard shortcuts

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