postgresql

package
v0.0.0-...-5905bd6 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const OtelName = "github.com/danicc097/openapi-go-gin-postgres-sqlc/internal/repos/postgresql"

Variables

This section is empty.

Functions

func New

func New(logger *zap.SugaredLogger) (*pgxpool.Pool, *sql.DB, error)

New instantiates the PostgreSQL database using configuration defined in environment variables.

Types

type Activity

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

Activity represents the repository used for interacting with Activity records.

func NewActivity

func NewActivity() *Activity

NewActivity instantiates the Activity repository.

func (*Activity) ByID

func (*Activity) ByName

func (a *Activity) ByName(ctx context.Context, d db.DBTX, name string, projectID db.ProjectID, opts ...db.ActivitySelectConfigOption) (*db.Activity, error)

func (*Activity) ByProjectID

func (a *Activity) ByProjectID(ctx context.Context, d db.DBTX, projectID db.ProjectID, opts ...db.ActivitySelectConfigOption) ([]db.Activity, error)

func (*Activity) Create

func (a *Activity) Create(ctx context.Context, d db.DBTX, params *db.ActivityCreateParams) (*db.Activity, error)

func (*Activity) Delete

func (a *Activity) Delete(ctx context.Context, d db.DBTX, id db.ActivityID) (*db.Activity, error)

func (*Activity) Update

func (a *Activity) Update(ctx context.Context, d db.DBTX, id db.ActivityID, params *db.ActivityUpdateParams) (*db.Activity, error)

type DemoTwoWorkItem

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

DemoTwoWorkItem represents the repository used for interacting with DemoTwoWorkItem records.

func NewDemoTwoWorkItem

func NewDemoTwoWorkItem() *DemoTwoWorkItem

NewDemoTwoWorkItem instantiates the DemoTwoWorkItem repository.

func (*DemoTwoWorkItem) ByID

func (*DemoTwoWorkItem) Create

func (*DemoTwoWorkItem) Update

type DemoWorkItem

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

DemoWorkItem represents the repository used for interacting with DemoWorkItem records.

func NewDemoWorkItem

func NewDemoWorkItem() *DemoWorkItem

NewDemoWorkItem instantiates the DemoWorkItem repository.

func (*DemoWorkItem) ByID

func (*DemoWorkItem) Create

func (*DemoWorkItem) Update

type KanbanStep

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

KanbanStep represents the repository used for interacting with KanbanStep records.

func NewKanbanStep

func NewKanbanStep() *KanbanStep

NewKanbanStep instantiates the KanbanStep repository.

func (*KanbanStep) ByID

func (*KanbanStep) ByProject

func (k *KanbanStep) ByProject(ctx context.Context, d db.DBTX, projectID db.ProjectID, opts ...db.KanbanStepSelectConfigOption) ([]db.KanbanStep, error)

type Notification

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

Notification represents the repository used for interacting with Notification records.

func NewNotification

func NewNotification() *Notification

NewNotification instantiates the Notification repository.

func (*Notification) Create

func (*Notification) Delete

func (*Notification) LatestUserNotifications

func (u *Notification) LatestUserNotifications(ctx context.Context, d db.DBTX, params *db.GetUserNotificationsParams) ([]db.GetUserNotificationsRow, error)

type Project

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

Project represents the repository used for interacting with Project records.

func NewProject

func NewProject() *Project

NewProject instantiates the Project repository.

func (*Project) ByID

func (u *Project) ByID(ctx context.Context, d db.DBTX, id db.ProjectID, opts ...db.ProjectSelectConfigOption) (*db.Project, error)

func (*Project) ByName

func (u *Project) ByName(ctx context.Context, d db.DBTX, name models.Project, opts ...db.ProjectSelectConfigOption) (*db.Project, error)

func (*Project) UpdateBoardConfig

func (u *Project) UpdateBoardConfig(ctx context.Context, d db.DBTX, projectID db.ProjectID, paths []string, obj any) error

type QuerierWrapper

type QuerierWrapper struct{ db.Querier }

QuerierWrapper implements db.Querier and wraps errors with the associated query name.

func NewQuerierWrapper

func NewQuerierWrapper(base db.Querier) QuerierWrapper

NewQuerierWrapper returns QuerierWrapper with wrapped pgx errors.

func (QuerierWrapper) GetUser

func (w QuerierWrapper) GetUser(ctx context.Context, db db.DBTX, arg db.GetUserParams) (g1 db.GetUserRow, err error)

func (QuerierWrapper) GetUserNotifications

func (w QuerierWrapper) GetUserNotifications(ctx context.Context, db db.DBTX, arg db.GetUserNotificationsParams) (ga1 []db.GetUserNotificationsRow, err error)

func (QuerierWrapper) RegisterNewUser

func (w QuerierWrapper) RegisterNewUser(ctx context.Context, db db.DBTX, arg db.RegisterNewUserParams) (r1 db.RegisterNewUserRow, err error)

func (QuerierWrapper) Test

func (w QuerierWrapper) Test(ctx context.Context, db db.DBTX) (err error)

type Team

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

Team represents the repository used for interacting with Team records.

func NewTeam

func NewTeam() *Team

NewTeam instantiates the Team repository.

func (*Team) ByID

func (t *Team) ByID(ctx context.Context, d db.DBTX, id db.TeamID, opts ...db.TeamSelectConfigOption) (*db.Team, error)

func (*Team) ByName

func (t *Team) ByName(ctx context.Context, d db.DBTX, name string, projectID db.ProjectID, opts ...db.TeamSelectConfigOption) (*db.Team, error)

func (*Team) Create

func (t *Team) Create(ctx context.Context, d db.DBTX, params *db.TeamCreateParams) (*db.Team, error)

func (*Team) Delete

func (t *Team) Delete(ctx context.Context, d db.DBTX, id db.TeamID) (*db.Team, error)

func (*Team) Update

func (t *Team) Update(ctx context.Context, d db.DBTX, id db.TeamID, params *db.TeamUpdateParams) (*db.Team, error)

type TimeEntry

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

TimeEntry represents the repository used for interacting with TimeEntry records.

func NewTimeEntry

func NewTimeEntry() *TimeEntry

NewTimeEntry instantiates the TimeEntry repository.

func (*TimeEntry) ByID

func (*TimeEntry) Create

func (wit *TimeEntry) Create(ctx context.Context, d db.DBTX, params *db.TimeEntryCreateParams) (*db.TimeEntry, error)

func (*TimeEntry) Delete

func (wit *TimeEntry) Delete(ctx context.Context, d db.DBTX, id db.TimeEntryID) (*db.TimeEntry, error)

func (*TimeEntry) Update

func (wit *TimeEntry) Update(ctx context.Context, d db.DBTX, id db.TimeEntryID, params *db.TimeEntryUpdateParams) (*db.TimeEntry, error)

type User

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

User represents the repository used for interacting with User records.

func NewUser

func NewUser() *User

NewUser instantiates the User repository.

func (*User) ByAPIKey

func (u *User) ByAPIKey(ctx context.Context, d db.DBTX, apiKey string) (*db.User, error)

func (*User) ByEmail

func (u *User) ByEmail(ctx context.Context, d db.DBTX, email string, opts ...db.UserSelectConfigOption) (*db.User, error)

func (*User) ByExternalID

func (u *User) ByExternalID(ctx context.Context, d db.DBTX, extID string, opts ...db.UserSelectConfigOption) (*db.User, error)

func (*User) ByID

func (u *User) ByID(ctx context.Context, d db.DBTX, id db.UserID, opts ...db.UserSelectConfigOption) (*db.User, error)

func (*User) ByProject

func (u *User) ByProject(ctx context.Context, d db.DBTX, projectID db.ProjectID) ([]db.User, error)

func (*User) ByTeam

func (u *User) ByTeam(ctx context.Context, d db.DBTX, teamID db.TeamID) ([]db.User, error)

func (*User) ByUsername

func (u *User) ByUsername(ctx context.Context, d db.DBTX, username string, opts ...db.UserSelectConfigOption) (*db.User, error)

func (*User) Create

func (u *User) Create(ctx context.Context, d db.DBTX, params *db.UserCreateParams) (*db.User, error)

func (*User) CreateAPIKey

func (u *User) CreateAPIKey(ctx context.Context, d db.DBTX, user *db.User) (*db.UserAPIKey, error)

func (*User) Delete

func (u *User) Delete(ctx context.Context, d db.DBTX, id db.UserID) (*db.User, error)

func (*User) DeleteAPIKey

func (u *User) DeleteAPIKey(ctx context.Context, d db.DBTX, apiKey string) (*db.UserAPIKey, error)

func (*User) Update

func (u *User) Update(ctx context.Context, d db.DBTX, id db.UserID, params *db.UserUpdateParams) (*db.User, error)

type WorkItem

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

WorkItem represents the repository used for interacting with WorkItem records.

func NewWorkItem

func NewWorkItem() *WorkItem

NewWorkItem instantiates the WorkItem repository. NOTE: maybe we can consider work item an aggregate root, since we don't need distinction between projects for some tasks like assigning members, tags, generic functionality like Delete, Restore... and this simplifies everything a lot.

func (*WorkItem) AssignTag

func (w *WorkItem) AssignTag(ctx context.Context, d db.DBTX, params *db.WorkItemWorkItemTagCreateParams) error

func (*WorkItem) AssignUser

func (w *WorkItem) AssignUser(ctx context.Context, d db.DBTX, params *db.WorkItemAssignedUserCreateParams) error

func (*WorkItem) ByID

func (*WorkItem) Delete

func (w *WorkItem) Delete(ctx context.Context, d db.DBTX, id db.WorkItemID) (*db.WorkItem, error)

func (*WorkItem) RemoveAssignedUser

func (w *WorkItem) RemoveAssignedUser(ctx context.Context, d db.DBTX, memberID db.UserID, workItemID db.WorkItemID) error

func (*WorkItem) RemoveTag

func (w *WorkItem) RemoveTag(ctx context.Context, d db.DBTX, tagID db.WorkItemTagID, workItemID db.WorkItemID) error

func (*WorkItem) Restore

func (w *WorkItem) Restore(ctx context.Context, d db.DBTX, id db.WorkItemID) (*db.WorkItem, error)

type WorkItemComment

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

WorkItemComment represents the repository used for interacting with WorkItemComment records.

func NewWorkItemComment

func NewWorkItemComment() *WorkItemComment

NewWorkItemComment instantiates the WorkItemComment repository.

func (*WorkItemComment) ByID

func (*WorkItemComment) Create

func (*WorkItemComment) Delete

func (*WorkItemComment) Update

type WorkItemTag

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

WorkItemTag represents the repository used for interacting with WorkItemTag records.

func NewWorkItemTag

func NewWorkItemTag() *WorkItemTag

NewWorkItemTag instantiates the WorkItemTag repository.

func (*WorkItemTag) ByID

func (*WorkItemTag) ByName

func (wit *WorkItemTag) ByName(ctx context.Context, d db.DBTX, name string, projectID db.ProjectID, opts ...db.WorkItemTagSelectConfigOption) (*db.WorkItemTag, error)

func (*WorkItemTag) Create

func (wit *WorkItemTag) Create(ctx context.Context, d db.DBTX, params *db.WorkItemTagCreateParams) (*db.WorkItemTag, error)

func (*WorkItemTag) Delete

func (wit *WorkItemTag) Delete(ctx context.Context, d db.DBTX, id db.WorkItemTagID) (*db.WorkItemTag, error)

func (*WorkItemTag) Update

type WorkItemType

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

WorkItemType represents the repository used for interacting with WorkItemType records.

func NewWorkItemType

func NewWorkItemType() *WorkItemType

NewWorkItemType instantiates the WorkItemType repository.

func (*WorkItemType) ByID

func (*WorkItemType) ByName

func (wit *WorkItemType) ByName(ctx context.Context, d db.DBTX, name string, projectID db.ProjectID, opts ...db.WorkItemTypeSelectConfigOption) (*db.WorkItemType, error)

Directories

Path Synopsis
gen
db
xo-templates

Jump to

Keyboard shortcuts

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