db

package
v1.0.0-preview2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(connString string)

Types

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 GetIterationBurndownRow

type GetIterationBurndownRow struct {
	IterationDay pgtype.Date
	Remaining    pgtype.Numeric
	Ideal        pgtype.Numeric
}

type GetProjectBurnupParams

type GetProjectBurnupParams struct {
	ProjectID int32
	Column2   pgtype.Timestamp
}

type GetProjectBurnupRow

type GetProjectBurnupRow struct {
	Status     string
	ProjectDay pgtype.Date
	Qty        pgtype.Numeric
}

type GetWorkItemsForIterationRow

type GetWorkItemsForIterationRow struct {
	ID             int32
	ChangeDate     pgtype.Date
	GhID           string
	Name           string
	Status         pgtype.Text
	Priority       pgtype.Int4
	RemainingHours pgtype.Int4
	Effort         pgtype.Int4
	IterationID    pgtype.Int4
	ProjectID      int32
	ID_2           int32
	GhID_2         string
	Name_2         string
	StartDate      pgtype.Date
	EndDate        pgtype.Date
	ProjectID_2    int32
}

type Iteration

type Iteration struct {
	ID        int32
	GhID      string
	Name      string
	StartDate pgtype.Date
	EndDate   pgtype.Date
	ProjectID int32
}

type Project

type Project struct {
	ID   int32
	GhID string
	Name string
}

type Querier

type Querier interface {
	GetIterationBurndown(ctx context.Context, id int32) ([]GetIterationBurndownRow, error)
	GetIterations(ctx context.Context, projectID int32) ([]Iteration, error)
	GetProjectBurnup(ctx context.Context, arg GetProjectBurnupParams) ([]GetProjectBurnupRow, error)
	GetProjects(ctx context.Context) ([]Project, error)
	GetWorkItemsForIteration(ctx context.Context, name string) ([]GetWorkItemsForIterationRow, error)
	UpsertIteration(ctx context.Context, arg UpsertIterationParams) (Iteration, error)
	UpsertProject(ctx context.Context, arg UpsertProjectParams) (Project, error)
	UpsertWorkItem(ctx context.Context, arg UpsertWorkItemParams) (WorkItemHistory, error)
	UpsertWorkItemStatus(ctx context.Context, name string) (WorkItemStatus, error)
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetIterationBurndown

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

func (*Queries) GetIterations

func (q *Queries) GetIterations(ctx context.Context, projectID int32) ([]Iteration, error)

func (*Queries) GetProjectBurnup

func (q *Queries) GetProjectBurnup(ctx context.Context, arg GetProjectBurnupParams) ([]GetProjectBurnupRow, error)

func (*Queries) GetProjects

func (q *Queries) GetProjects(ctx context.Context) ([]Project, error)

func (*Queries) GetWorkItemsForIteration

func (q *Queries) GetWorkItemsForIteration(ctx context.Context, name string) ([]GetWorkItemsForIterationRow, error)

func (*Queries) UpsertIteration

func (q *Queries) UpsertIteration(ctx context.Context, arg UpsertIterationParams) (Iteration, error)

func (*Queries) UpsertProject

func (q *Queries) UpsertProject(ctx context.Context, arg UpsertProjectParams) (Project, error)

func (*Queries) UpsertWorkItem

func (q *Queries) UpsertWorkItem(ctx context.Context, arg UpsertWorkItemParams) (WorkItemHistory, error)

func (*Queries) UpsertWorkItemStatus

func (q *Queries) UpsertWorkItemStatus(ctx context.Context, name string) (WorkItemStatus, error)

func (*Queries) WithTx

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

type UpsertIterationParams

type UpsertIterationParams struct {
	GhID      string
	Name      string
	StartDate pgtype.Date
	EndDate   pgtype.Date
	ProjectID int32
}

type UpsertProjectParams

type UpsertProjectParams struct {
	GhID string
	Name string
}

type UpsertWorkItemParams

type UpsertWorkItemParams struct {
	ChangeDate     pgtype.Date
	GhID           string
	Name           string
	Status         pgtype.Text
	Priority       pgtype.Int4
	RemainingHours pgtype.Int4
	Effort         pgtype.Int4
	IterationID    pgtype.Int4
	ProjectID      int32
}

type WorkItemHistory

type WorkItemHistory struct {
	ID             int32
	ChangeDate     pgtype.Date
	GhID           string
	Name           string
	Status         pgtype.Text
	Priority       pgtype.Int4
	RemainingHours pgtype.Int4
	Effort         pgtype.Int4
	IterationID    pgtype.Int4
	ProjectID      int32
}

type WorkItemStatus

type WorkItemStatus struct {
	ID   int16
	Name string
}

Jump to

Keyboard shortcuts

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