db

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: 15 Imported by: 0

Documentation

Index

Constants

View Source
const GetUser = `` /* 356-byte string literal not displayed */
View Source
const GetUserNotifications = `` /* 646-byte string literal not displayed */
View Source
const RegisterNewUser = `` /* 180-byte string literal not displayed */
View Source
const Test = `-- name: Test :exec
select
  user_id
  , username
  , email
  , role_rank
  , created_at
  , updated_at
from
  users
`

Variables

This section is empty.

Functions

func Errorf

func Errorf(s string, v ...interface{})

Errorf logs an error message using the package error logger.

func JsonbSetDeep

func JsonbSetDeep(ctx context.Context, db DB, target map[string]any, path []string, val map[string]any) (map[string]any, error)

JsonbSetDeep calls the stored function 'public.jsonb_set_deep(jsonb, text, jsonb) jsonb' on db.

func Logf

func Logf(s string, v ...interface{})

Logf logs a message using the package logger.

func SetErrorLogger

func SetErrorLogger(logger interface{})

SetErrorLogger sets the package error logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

func SetLogger

func SetLogger(logger interface{})

SetLogger sets the package logger. Valid logger types:

io.Writer
func(string, ...interface{}) (int, error) // fmt.Printf
func(string, ...interface{}) // log.Printf

Types

type Activity

type Activity struct {
	ActivityID   ActivityID `json:"activityID" db:"activity_id" required:"true" nullable:"false"`     // activity_id
	ProjectID    ProjectID  `json:"projectID" db:"project_id" required:"true" nullable:"false"`       // project_id
	Name         string     `json:"name" db:"name" required:"true" nullable:"false"`                  // name
	Description  string     `json:"description" db:"description" required:"true" nullable:"false"`    // description
	IsProductive bool       `json:"isProductive" db:"is_productive" required:"true" nullable:"false"` // is_productive

	ProjectJoin             *Project     `json:"-" db:"project_project_id" openapi-go:"ignore"` // O2O projects (generated from M2O)
	ActivityTimeEntriesJoin *[]TimeEntry `json:"-" db:"time_entries" openapi-go:"ignore"`       // M2O activities

}

Activity represents a row from 'public.activities'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func ActivitiesByName

func ActivitiesByName(ctx context.Context, db DB, name string, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivitiesByName retrieves a row from 'public.activities' as a Activity.

Generated from index 'activities_name_project_id_key'.

func ActivitiesByProjectID

func ActivitiesByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivitiesByProjectID retrieves a row from 'public.activities' as a Activity.

Generated from index 'activities_name_project_id_key'.

func ActivityByActivityID

func ActivityByActivityID(ctx context.Context, db DB, activityID ActivityID, opts ...ActivitySelectConfigOption) (*Activity, error)

ActivityByActivityID retrieves a row from 'public.activities' as a Activity.

Generated from index 'activities_pkey'.

func ActivityByNameProjectID

func ActivityByNameProjectID(ctx context.Context, db DB, name string, projectID ProjectID, opts ...ActivitySelectConfigOption) (*Activity, error)

ActivityByNameProjectID retrieves a row from 'public.activities' as a Activity.

Generated from index 'activities_name_project_id_key'.

func ActivityPaginatedByActivityIDAsc

func ActivityPaginatedByActivityIDAsc(ctx context.Context, db DB, activityID ActivityID, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivityPaginatedByActivityIDAsc returns a cursor-paginated list of Activity in Asc order.

func ActivityPaginatedByActivityIDDesc

func ActivityPaginatedByActivityIDDesc(ctx context.Context, db DB, activityID ActivityID, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivityPaginatedByActivityIDDesc returns a cursor-paginated list of Activity in Desc order.

func ActivityPaginatedByProjectIDAsc

func ActivityPaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivityPaginatedByProjectIDAsc returns a cursor-paginated list of Activity in Asc order.

func ActivityPaginatedByProjectIDDesc

func ActivityPaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...ActivitySelectConfigOption) ([]Activity, error)

ActivityPaginatedByProjectIDDesc returns a cursor-paginated list of Activity in Desc order.

func CreateActivity

func CreateActivity(ctx context.Context, db DB, params *ActivityCreateParams) (*Activity, error)

CreateActivity creates a new Activity in the database with the given params.

func (*Activity) Delete

func (a *Activity) Delete(ctx context.Context, db DB) error

Delete deletes the Activity from the database.

func (*Activity) FKProject_ProjectID

func (a *Activity) FKProject_ProjectID(ctx context.Context, db DB) (*Project, error)

FKProject_ProjectID returns the Project associated with the Activity's (ProjectID).

Generated from foreign key 'activities_project_id_fkey'.

func (*Activity) Insert

func (a *Activity) Insert(ctx context.Context, db DB) (*Activity, error)

Insert inserts the Activity to the database.

func (*Activity) SetUpdateParams

func (a *Activity) SetUpdateParams(params *ActivityUpdateParams)

SetUpdateParams updates public.activities struct fields with the specified params.

func (*Activity) Update

func (a *Activity) Update(ctx context.Context, db DB) (*Activity, error)

Update updates a Activity in the database.

func (*Activity) Upsert

func (a *Activity) Upsert(ctx context.Context, db DB, params *ActivityCreateParams) (*Activity, error)

Upsert upserts a Activity in the database. Requires appropriate PK(s) to be set beforehand.

type ActivityCreateParams

type ActivityCreateParams struct {
	Description  string    `json:"description" required:"true" nullable:"false"`  // description
	IsProductive bool      `json:"isProductive" required:"true" nullable:"false"` // is_productive
	Name         string    `json:"name" required:"true" nullable:"false"`         // name
	ProjectID    ProjectID `json:"projectID" nullable:"false"`                    // project_id
}

ActivityCreateParams represents insert params for 'public.activities'.

type ActivityID

type ActivityID int

type ActivityJoins

type ActivityJoins struct {
	Project     bool // O2O projects
	TimeEntries bool // M2O time_entries
}

type ActivityOrderBy

type ActivityOrderBy string

type ActivitySelectConfig

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

type ActivitySelectConfigOption

type ActivitySelectConfigOption func(*ActivitySelectConfig)

func WithActivityFilters

func WithActivityFilters(filters map[string][]any) ActivitySelectConfigOption

WithActivityFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithActivityJoin

func WithActivityJoin(joins ActivityJoins) ActivitySelectConfigOption

WithActivityJoin joins with the given tables.

func WithActivityLimit

func WithActivityLimit(limit int) ActivitySelectConfigOption

WithActivityLimit limits row selection.

type ActivityUpdateParams

type ActivityUpdateParams struct {
	Description  *string    `json:"description" nullable:"false"`  // description
	IsProductive *bool      `json:"isProductive" nullable:"false"` // is_productive
	Name         *string    `json:"name" nullable:"false"`         // name
	ProjectID    *ProjectID `json:"projectID" nullable:"false"`    // project_id
}

ActivityUpdateParams represents update params for 'public.activities'.

type DB

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

DB is the common interface for database operations that can be used with types from schema 'public'.

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 DemoTwoWorkItem

type DemoTwoWorkItem struct {
	WorkItemID            WorkItemID `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"` // work_item_id
	CustomDateForProject2 *time.Time `json:"customDateForProject2" db:"custom_date_for_project_2"`          // custom_date_for_project_2

	WorkItemJoin *WorkItem `json:"-" db:"work_item_work_item_id" openapi-go:"ignore"` // O2O work_items (inferred)

}

DemoTwoWorkItem represents a row from 'public.demo_two_work_items'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateDemoTwoWorkItem

func CreateDemoTwoWorkItem(ctx context.Context, db DB, params *DemoTwoWorkItemCreateParams) (*DemoTwoWorkItem, error)

CreateDemoTwoWorkItem creates a new DemoTwoWorkItem in the database with the given params.

func DemoTwoWorkItemByWorkItemID

func DemoTwoWorkItemByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoTwoWorkItemSelectConfigOption) (*DemoTwoWorkItem, error)

DemoTwoWorkItemByWorkItemID retrieves a row from 'public.demo_two_work_items' as a DemoTwoWorkItem.

Generated from index 'demo_two_work_items_pkey'.

func DemoTwoWorkItemPaginatedByWorkItemIDAsc

func DemoTwoWorkItemPaginatedByWorkItemIDAsc(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoTwoWorkItemSelectConfigOption) ([]DemoTwoWorkItem, error)

DemoTwoWorkItemPaginatedByWorkItemIDAsc returns a cursor-paginated list of DemoTwoWorkItem in Asc order.

func DemoTwoWorkItemPaginatedByWorkItemIDDesc

func DemoTwoWorkItemPaginatedByWorkItemIDDesc(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoTwoWorkItemSelectConfigOption) ([]DemoTwoWorkItem, error)

DemoTwoWorkItemPaginatedByWorkItemIDDesc returns a cursor-paginated list of DemoTwoWorkItem in Desc order.

func (*DemoTwoWorkItem) Delete

func (dtwi *DemoTwoWorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the DemoTwoWorkItem from the database.

func (*DemoTwoWorkItem) FKWorkItem_WorkItemID

func (dtwi *DemoTwoWorkItem) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the DemoTwoWorkItem's (WorkItemID).

Generated from foreign key 'demo_two_work_items_work_item_id_fkey'.

func (*DemoTwoWorkItem) Insert

func (dtwi *DemoTwoWorkItem) Insert(ctx context.Context, db DB) (*DemoTwoWorkItem, error)

Insert inserts the DemoTwoWorkItem to the database.

func (*DemoTwoWorkItem) SetUpdateParams

func (dtwi *DemoTwoWorkItem) SetUpdateParams(params *DemoTwoWorkItemUpdateParams)

SetUpdateParams updates public.demo_two_work_items struct fields with the specified params.

func (*DemoTwoWorkItem) Update

func (dtwi *DemoTwoWorkItem) Update(ctx context.Context, db DB) (*DemoTwoWorkItem, error)

Update updates a DemoTwoWorkItem in the database.

func (*DemoTwoWorkItem) Upsert

Upsert upserts a DemoTwoWorkItem in the database. Requires appropriate PK(s) to be set beforehand.

type DemoTwoWorkItemCreateParams

type DemoTwoWorkItemCreateParams struct {
	CustomDateForProject2 *time.Time `json:"customDateForProject2"`              // custom_date_for_project_2
	WorkItemID            WorkItemID `json:"-" required:"true" nullable:"false"` // work_item_id
}

DemoTwoWorkItemCreateParams represents insert params for 'public.demo_two_work_items'.

type DemoTwoWorkItemJoins

type DemoTwoWorkItemJoins struct {
	WorkItem bool // O2O work_items
}

type DemoTwoWorkItemOrderBy

type DemoTwoWorkItemOrderBy string
const (
	DemoTwoWorkItemCustomDateForProject2DescNullsFirst DemoTwoWorkItemOrderBy = " custom_date_for_project_2 DESC NULLS FIRST "
	DemoTwoWorkItemCustomDateForProject2DescNullsLast  DemoTwoWorkItemOrderBy = " custom_date_for_project_2 DESC NULLS LAST "
	DemoTwoWorkItemCustomDateForProject2AscNullsFirst  DemoTwoWorkItemOrderBy = " custom_date_for_project_2 ASC NULLS FIRST "
	DemoTwoWorkItemCustomDateForProject2AscNullsLast   DemoTwoWorkItemOrderBy = " custom_date_for_project_2 ASC NULLS LAST "
)

type DemoTwoWorkItemSelectConfig

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

type DemoTwoWorkItemSelectConfigOption

type DemoTwoWorkItemSelectConfigOption func(*DemoTwoWorkItemSelectConfig)

func WithDemoTwoWorkItemFilters

func WithDemoTwoWorkItemFilters(filters map[string][]any) DemoTwoWorkItemSelectConfigOption

WithDemoTwoWorkItemFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithDemoTwoWorkItemJoin

func WithDemoTwoWorkItemJoin(joins DemoTwoWorkItemJoins) DemoTwoWorkItemSelectConfigOption

WithDemoTwoWorkItemJoin joins with the given tables.

func WithDemoTwoWorkItemLimit

func WithDemoTwoWorkItemLimit(limit int) DemoTwoWorkItemSelectConfigOption

WithDemoTwoWorkItemLimit limits row selection.

func WithDemoTwoWorkItemOrderBy

func WithDemoTwoWorkItemOrderBy(rows ...DemoTwoWorkItemOrderBy) DemoTwoWorkItemSelectConfigOption

WithDemoTwoWorkItemOrderBy orders results by the given columns.

type DemoTwoWorkItemUpdateParams

type DemoTwoWorkItemUpdateParams struct {
	CustomDateForProject2 **time.Time `json:"customDateForProject2"` // custom_date_for_project_2
}

DemoTwoWorkItemUpdateParams represents update params for 'public.demo_two_work_items'.

type DemoWorkItem

type DemoWorkItem struct {
	WorkItemID    WorkItemID `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`       // work_item_id
	Ref           string     `json:"ref" db:"ref" required:"true" nullable:"false" pattern:"^[0-9]{8}$"`  // ref
	Line          string     `json:"line" db:"line" required:"true" nullable:"false"`                     // line
	LastMessageAt time.Time  `json:"lastMessageAt" db:"last_message_at" required:"true" nullable:"false"` // last_message_at
	Reopened      bool       `json:"reopened" db:"reopened" required:"true" nullable:"false"`             // reopened

	WorkItemJoin *WorkItem `json:"-" db:"work_item_work_item_id" openapi-go:"ignore"` // O2O work_items (inferred)

}

DemoWorkItem represents a row from 'public.demo_work_items'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateDemoWorkItem

func CreateDemoWorkItem(ctx context.Context, db DB, params *DemoWorkItemCreateParams) (*DemoWorkItem, error)

CreateDemoWorkItem creates a new DemoWorkItem in the database with the given params.

func DemoWorkItemByWorkItemID

func DemoWorkItemByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoWorkItemSelectConfigOption) (*DemoWorkItem, error)

DemoWorkItemByWorkItemID retrieves a row from 'public.demo_work_items' as a DemoWorkItem.

Generated from index 'demo_work_items_pkey'.

func DemoWorkItemPaginatedByWorkItemIDAsc

func DemoWorkItemPaginatedByWorkItemIDAsc(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoWorkItemSelectConfigOption) ([]DemoWorkItem, error)

DemoWorkItemPaginatedByWorkItemIDAsc returns a cursor-paginated list of DemoWorkItem in Asc order.

func DemoWorkItemPaginatedByWorkItemIDDesc

func DemoWorkItemPaginatedByWorkItemIDDesc(ctx context.Context, db DB, workItemID WorkItemID, opts ...DemoWorkItemSelectConfigOption) ([]DemoWorkItem, error)

DemoWorkItemPaginatedByWorkItemIDDesc returns a cursor-paginated list of DemoWorkItem in Desc order.

func DemoWorkItemsByRefLine

func DemoWorkItemsByRefLine(ctx context.Context, db DB, ref string, line string, opts ...DemoWorkItemSelectConfigOption) ([]DemoWorkItem, error)

DemoWorkItemsByRefLine retrieves a row from 'public.demo_work_items' as a DemoWorkItem.

Generated from index 'demo_work_items_ref_line_idx'.

func (*DemoWorkItem) Delete

func (dwi *DemoWorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the DemoWorkItem from the database.

func (*DemoWorkItem) FKWorkItem_WorkItemID

func (dwi *DemoWorkItem) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the DemoWorkItem's (WorkItemID).

Generated from foreign key 'demo_work_items_work_item_id_fkey'.

func (*DemoWorkItem) Insert

func (dwi *DemoWorkItem) Insert(ctx context.Context, db DB) (*DemoWorkItem, error)

Insert inserts the DemoWorkItem to the database.

func (*DemoWorkItem) SetUpdateParams

func (dwi *DemoWorkItem) SetUpdateParams(params *DemoWorkItemUpdateParams)

SetUpdateParams updates public.demo_work_items struct fields with the specified params.

func (*DemoWorkItem) Update

func (dwi *DemoWorkItem) Update(ctx context.Context, db DB) (*DemoWorkItem, error)

Update updates a DemoWorkItem in the database.

func (*DemoWorkItem) Upsert

func (dwi *DemoWorkItem) Upsert(ctx context.Context, db DB, params *DemoWorkItemCreateParams) (*DemoWorkItem, error)

Upsert upserts a DemoWorkItem in the database. Requires appropriate PK(s) to be set beforehand.

type DemoWorkItemCreateParams

type DemoWorkItemCreateParams struct {
	LastMessageAt time.Time  `json:"lastMessageAt" required:"true" nullable:"false"`            // last_message_at
	Line          string     `json:"line" required:"true" nullable:"false"`                     // line
	Ref           string     `json:"ref" required:"true" nullable:"false" pattern:"^[0-9]{8}$"` // ref
	Reopened      bool       `json:"reopened" required:"true" nullable:"false"`                 // reopened
	WorkItemID    WorkItemID `json:"-" required:"true" nullable:"false"`                        // work_item_id
}

DemoWorkItemCreateParams represents insert params for 'public.demo_work_items'.

type DemoWorkItemJoins

type DemoWorkItemJoins struct {
	WorkItem bool // O2O work_items
}

type DemoWorkItemOrderBy

type DemoWorkItemOrderBy string
const (
	DemoWorkItemLastMessageAtDescNullsFirst DemoWorkItemOrderBy = " last_message_at DESC NULLS FIRST "
	DemoWorkItemLastMessageAtDescNullsLast  DemoWorkItemOrderBy = " last_message_at DESC NULLS LAST "
	DemoWorkItemLastMessageAtAscNullsFirst  DemoWorkItemOrderBy = " last_message_at ASC NULLS FIRST "
	DemoWorkItemLastMessageAtAscNullsLast   DemoWorkItemOrderBy = " last_message_at ASC NULLS LAST "
)

type DemoWorkItemSelectConfig

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

type DemoWorkItemSelectConfigOption

type DemoWorkItemSelectConfigOption func(*DemoWorkItemSelectConfig)

func WithDemoWorkItemFilters

func WithDemoWorkItemFilters(filters map[string][]any) DemoWorkItemSelectConfigOption

WithDemoWorkItemFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithDemoWorkItemJoin

func WithDemoWorkItemJoin(joins DemoWorkItemJoins) DemoWorkItemSelectConfigOption

WithDemoWorkItemJoin joins with the given tables.

func WithDemoWorkItemLimit

func WithDemoWorkItemLimit(limit int) DemoWorkItemSelectConfigOption

WithDemoWorkItemLimit limits row selection.

func WithDemoWorkItemOrderBy

func WithDemoWorkItemOrderBy(rows ...DemoWorkItemOrderBy) DemoWorkItemSelectConfigOption

WithDemoWorkItemOrderBy orders results by the given columns.

type DemoWorkItemUpdateParams

type DemoWorkItemUpdateParams struct {
	LastMessageAt *time.Time `json:"lastMessageAt" nullable:"false"`            // last_message_at
	Line          *string    `json:"line" nullable:"false"`                     // line
	Ref           *string    `json:"ref" nullable:"false" pattern:"^[0-9]{8}$"` // ref
	Reopened      *bool      `json:"reopened" nullable:"false"`                 // reopened
}

DemoWorkItemUpdateParams represents update params for 'public.demo_work_items'.

type Entity

type Entity string
const (
	ActivityEntity             Entity = "Activity"
	DemoTwoWorkItemEntity      Entity = "DemoTwoWorkItem"
	DemoWorkItemEntity         Entity = "DemoWorkItem"
	EntityNotificationEntity   Entity = "EntityNotification"
	KanbanStepEntity           Entity = "KanbanStep"
	MovieEntity                Entity = "Movie"
	NotificationEntity         Entity = "Notification"
	ProjectEntity              Entity = "Project"
	SchemaMigrationEntity      Entity = "SchemaMigration"
	TeamEntity                 Entity = "Team"
	TimeEntryEntity            Entity = "TimeEntry"
	UserEntity                 Entity = "User"
	UserAPIKeyEntity           Entity = "UserAPIKey"
	UserNotificationEntity     Entity = "UserNotification"
	UserTeamEntity             Entity = "UserTeam"
	WorkItemEntity             Entity = "WorkItem"
	WorkItemAssignedUserEntity Entity = "WorkItemAssignedUser"
	WorkItemCommentEntity      Entity = "WorkItemComment"
	WorkItemTagEntity          Entity = "WorkItemTag"
	WorkItemTypeEntity         Entity = "WorkItemType"
	WorkItemWorkItemTagEntity  Entity = "WorkItemWorkItemTag"
)

type EntityNotification

type EntityNotification struct {
	EntityNotificationID EntityNotificationID `json:"entityNotificationID" db:"entity_notification_id" required:"true" nullable:"false"`       // entity_notification_id
	Entity               Entity               `json:"entity" db:"entity" required:"true" nullable:"false" ref:"#/components/schemas/DbEntity"` // entity
	ID                   string               `json:"id" db:"id" required:"true" nullable:"false"`                                             // id
	Message              string               `json:"message" db:"message" required:"true" nullable:"false"`                                   // message
	Topic                models.Topics        `json:"topic" db:"topic" required:"true" nullable:"false" ref:"#/components/schemas/Topics"`     // topic
	CreatedAt            time.Time            `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                              // created_at

}

EntityNotification represents a row from 'public.entity_notifications'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateEntityNotification

func CreateEntityNotification(ctx context.Context, db DB, params *EntityNotificationCreateParams) (*EntityNotification, error)

CreateEntityNotification creates a new EntityNotification in the database with the given params.

func EntityNotificationByEntityNotificationID

func EntityNotificationByEntityNotificationID(ctx context.Context, db DB, entityNotificationID EntityNotificationID, opts ...EntityNotificationSelectConfigOption) (*EntityNotification, error)

EntityNotificationByEntityNotificationID retrieves a row from 'public.entity_notifications' as a EntityNotification.

Generated from index 'entity_notifications_pkey'.

func EntityNotificationPaginatedByEntityNotificationIDAsc

func EntityNotificationPaginatedByEntityNotificationIDAsc(ctx context.Context, db DB, entityNotificationID EntityNotificationID, opts ...EntityNotificationSelectConfigOption) ([]EntityNotification, error)

EntityNotificationPaginatedByEntityNotificationIDAsc returns a cursor-paginated list of EntityNotification in Asc order.

func EntityNotificationPaginatedByEntityNotificationIDDesc

func EntityNotificationPaginatedByEntityNotificationIDDesc(ctx context.Context, db DB, entityNotificationID EntityNotificationID, opts ...EntityNotificationSelectConfigOption) ([]EntityNotification, error)

EntityNotificationPaginatedByEntityNotificationIDDesc returns a cursor-paginated list of EntityNotification in Desc order.

func EntityNotificationsByEntityID

func EntityNotificationsByEntityID(ctx context.Context, db DB, entity Entity, id string, opts ...EntityNotificationSelectConfigOption) ([]EntityNotification, error)

EntityNotificationsByEntityID retrieves a row from 'public.entity_notifications' as a EntityNotification.

Generated from index 'entity_notifications_entity_id_idx'.

func (*EntityNotification) Delete

func (en *EntityNotification) Delete(ctx context.Context, db DB) error

Delete deletes the EntityNotification from the database.

func (*EntityNotification) Insert

func (en *EntityNotification) Insert(ctx context.Context, db DB) (*EntityNotification, error)

Insert inserts the EntityNotification to the database.

func (*EntityNotification) SetUpdateParams

func (en *EntityNotification) SetUpdateParams(params *EntityNotificationUpdateParams)

SetUpdateParams updates public.entity_notifications struct fields with the specified params.

func (*EntityNotification) Update

func (en *EntityNotification) Update(ctx context.Context, db DB) (*EntityNotification, error)

Update updates a EntityNotification in the database.

func (*EntityNotification) Upsert

Upsert upserts a EntityNotification in the database. Requires appropriate PK(s) to be set beforehand.

type EntityNotificationCreateParams

type EntityNotificationCreateParams struct {
	Entity  Entity        `json:"entity" required:"true" nullable:"false" ref:"#/components/schemas/DbEntity"` // entity
	ID      string        `json:"id" required:"true" nullable:"false"`                                         // id
	Message string        `json:"message" required:"true" nullable:"false"`                                    // message
	Topic   models.Topics `json:"topic" required:"true" nullable:"false" ref:"#/components/schemas/Topics"`    // topic
}

EntityNotificationCreateParams represents insert params for 'public.entity_notifications'.

type EntityNotificationID

type EntityNotificationID int

type EntityNotificationJoins

type EntityNotificationJoins struct {
}

type EntityNotificationOrderBy

type EntityNotificationOrderBy string
const (
	EntityNotificationCreatedAtDescNullsFirst EntityNotificationOrderBy = " created_at DESC NULLS FIRST "
	EntityNotificationCreatedAtDescNullsLast  EntityNotificationOrderBy = " created_at DESC NULLS LAST "
	EntityNotificationCreatedAtAscNullsFirst  EntityNotificationOrderBy = " created_at ASC NULLS FIRST "
	EntityNotificationCreatedAtAscNullsLast   EntityNotificationOrderBy = " created_at ASC NULLS LAST "
)

type EntityNotificationSelectConfig

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

type EntityNotificationSelectConfigOption

type EntityNotificationSelectConfigOption func(*EntityNotificationSelectConfig)

func WithEntityNotificationFilters

func WithEntityNotificationFilters(filters map[string][]any) EntityNotificationSelectConfigOption

WithEntityNotificationFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithEntityNotificationJoin

func WithEntityNotificationJoin(joins EntityNotificationJoins) EntityNotificationSelectConfigOption

WithEntityNotificationJoin joins with the given tables.

func WithEntityNotificationLimit

func WithEntityNotificationLimit(limit int) EntityNotificationSelectConfigOption

WithEntityNotificationLimit limits row selection.

func WithEntityNotificationOrderBy

func WithEntityNotificationOrderBy(rows ...EntityNotificationOrderBy) EntityNotificationSelectConfigOption

WithEntityNotificationOrderBy orders results by the given columns.

type EntityNotificationUpdateParams

type EntityNotificationUpdateParams struct {
	Entity  *Entity        `json:"entity" nullable:"false" ref:"#/components/schemas/DbEntity"` // entity
	ID      *string        `json:"id" nullable:"false"`                                         // id
	Message *string        `json:"message" nullable:"false"`                                    // message
	Topic   *models.Topics `json:"topic" nullable:"false" ref:"#/components/schemas/Topics"`    // topic
}

EntityNotificationUpdateParams represents update params for 'public.entity_notifications'.

type ErrInsertFailed

type ErrInsertFailed struct {
	Err error
}

ErrInsertFailed is the insert failed error.

func (*ErrInsertFailed) Error

func (err *ErrInsertFailed) Error() string

Error satisfies the error interface.

func (*ErrInsertFailed) Unwrap

func (err *ErrInsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrInvalidNotificationType

type ErrInvalidNotificationType string

ErrInvalidNotificationType is the invalid NotificationType error.

func (ErrInvalidNotificationType) Error

func (err ErrInvalidNotificationType) Error() string

Error satisfies the error interface.

type ErrInvalidWorkItemRole

type ErrInvalidWorkItemRole string

ErrInvalidWorkItemRole is the invalid WorkItemRole error.

func (ErrInvalidWorkItemRole) Error

func (err ErrInvalidWorkItemRole) Error() string

Error satisfies the error interface.

type ErrUpdateFailed

type ErrUpdateFailed struct {
	Err error
}

ErrUpdateFailed is the update failed error.

func (*ErrUpdateFailed) Error

func (err *ErrUpdateFailed) Error() string

Error satisfies the error interface.

func (*ErrUpdateFailed) Unwrap

func (err *ErrUpdateFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type ErrUpsertFailed

type ErrUpsertFailed struct {
	Err error
}

ErrUpsertFailed is the upsert failed error.

func (*ErrUpsertFailed) Error

func (err *ErrUpsertFailed) Error() string

Error satisfies the error interface.

func (*ErrUpsertFailed) Unwrap

func (err *ErrUpsertFailed) Unwrap() error

Unwrap satisfies the unwrap interface.

type Error

type Error string

Error is an error.

const (
	// ErrAlreadyExists is the already exists error.
	ErrAlreadyExists Error = "already exists"
	// ErrDoesNotExist is the does not exist error.
	ErrDoesNotExist Error = "does not exist"
	// ErrMarkedForDeletion is the marked for deletion error.
	ErrMarkedForDeletion Error = "marked for deletion"
)

Error values.

func (Error) Error

func (err Error) Error() string

Error satisfies the error interface.

type GetUserNotificationsParams

type GetUserNotificationsParams struct {
	UserID           uuid.UUID        `db:"user_id" json:"user_id"`
	NotificationType NotificationType `db:"notification_type" json:"notification_type"`
	MinCreatedAt     *time.Time       `db:"min_created_at" json:"min_created_at"`
	Lim              *int32           `db:"lim" json:"lim"`
}

type GetUserNotificationsRow

type GetUserNotificationsRow struct {
	UserNotificationID int64                `db:"user_notification_id" json:"user_notification_id"`
	NotificationID     int32                `db:"notification_id" json:"notification_id"`
	Read               bool                 `db:"read" json:"read"`
	UserID             uuid.UUID            `db:"user_id" json:"user_id"`
	NotificationType   NotificationType     `db:"notification_type" json:"notification_type"`
	Sender             uuid.UUID            `db:"sender" json:"sender"`
	Title              string               `db:"title" json:"title"`
	Body               string               `db:"body" json:"body"`
	Labels             pgtype.Array[string] `db:"labels" json:"labels"`
	Link               *string              `db:"link" json:"link"`
}

type GetUserParams

type GetUserParams struct {
	Email    *string    `db:"email" json:"email"`
	Username *string    `db:"username" json:"username"`
	UserID   *uuid.UUID `db:"user_id" json:"user_id"`
}

type GetUserRow

type GetUserRow struct {
	Username  string    `db:"username" json:"username"`
	Email     string    `db:"email" json:"email"`
	RoleRank  int16     `db:"role_rank" json:"role_rank"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
	UserID    uuid.UUID `db:"user_id" json:"user_id"`
}

type KanbanStep

type KanbanStep struct {
	KanbanStepID  KanbanStepID `json:"kanbanStepID" db:"kanban_step_id" required:"true" nullable:"false"`                              // kanban_step_id
	ProjectID     ProjectID    `json:"projectID" db:"project_id" required:"true" nullable:"false"`                                     // project_id
	StepOrder     int          `json:"stepOrder" db:"step_order" required:"true" nullable:"false"`                                     // step_order
	Name          string       `json:"name" db:"name" required:"true" nullable:"false"`                                                // name
	Description   string       `json:"description" db:"description" required:"true" nullable:"false"`                                  // description
	Color         string       `json:"color" db:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	TimeTrackable bool         `json:"timeTrackable" db:"time_trackable" required:"true" nullable:"false"`                             // time_trackable

	ProjectJoin *Project `json:"-" db:"project_project_id" openapi-go:"ignore"` // O2O projects (generated from M2O)

}

KanbanStep represents a row from 'public.kanban_steps'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateKanbanStep

func CreateKanbanStep(ctx context.Context, db DB, params *KanbanStepCreateParams) (*KanbanStep, error)

CreateKanbanStep creates a new KanbanStep in the database with the given params.

func KanbanStepByKanbanStepID

func KanbanStepByKanbanStepID(ctx context.Context, db DB, kanbanStepID KanbanStepID, opts ...KanbanStepSelectConfigOption) (*KanbanStep, error)

KanbanStepByKanbanStepID retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_pkey'.

func KanbanStepByProjectIDNameStepOrder

func KanbanStepByProjectIDNameStepOrder(ctx context.Context, db DB, projectID ProjectID, name string, stepOrder int, opts ...KanbanStepSelectConfigOption) (*KanbanStep, error)

KanbanStepByProjectIDNameStepOrder retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_project_id_name_step_order_idx'.

func KanbanStepByProjectIDStepOrder

func KanbanStepByProjectIDStepOrder(ctx context.Context, db DB, projectID ProjectID, stepOrder int, opts ...KanbanStepSelectConfigOption) (*KanbanStep, error)

KanbanStepByProjectIDStepOrder retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_project_id_step_order_key'.

func KanbanStepPaginatedByKanbanStepIDAsc

func KanbanStepPaginatedByKanbanStepIDAsc(ctx context.Context, db DB, kanbanStepID KanbanStepID, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByKanbanStepIDAsc returns a cursor-paginated list of KanbanStep in Asc order.

func KanbanStepPaginatedByKanbanStepIDDesc

func KanbanStepPaginatedByKanbanStepIDDesc(ctx context.Context, db DB, kanbanStepID KanbanStepID, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByKanbanStepIDDesc returns a cursor-paginated list of KanbanStep in Desc order.

func KanbanStepPaginatedByProjectIDAsc

func KanbanStepPaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByProjectIDAsc returns a cursor-paginated list of KanbanStep in Asc order.

func KanbanStepPaginatedByProjectIDDesc

func KanbanStepPaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByProjectIDDesc returns a cursor-paginated list of KanbanStep in Desc order.

func KanbanStepPaginatedByStepOrderAsc

func KanbanStepPaginatedByStepOrderAsc(ctx context.Context, db DB, stepOrder int, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByStepOrderAsc returns a cursor-paginated list of KanbanStep in Asc order.

func KanbanStepPaginatedByStepOrderDesc

func KanbanStepPaginatedByStepOrderDesc(ctx context.Context, db DB, stepOrder int, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepPaginatedByStepOrderDesc returns a cursor-paginated list of KanbanStep in Desc order.

func KanbanStepsByName

func KanbanStepsByName(ctx context.Context, db DB, name string, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepsByName retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_project_id_name_step_order_idx'.

func KanbanStepsByProjectID

func KanbanStepsByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepsByProjectID retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_project_id_name_step_order_idx'.

func KanbanStepsByStepOrder

func KanbanStepsByStepOrder(ctx context.Context, db DB, stepOrder int, opts ...KanbanStepSelectConfigOption) ([]KanbanStep, error)

KanbanStepsByStepOrder retrieves a row from 'public.kanban_steps' as a KanbanStep.

Generated from index 'kanban_steps_project_id_name_step_order_idx'.

func (*KanbanStep) Delete

func (ks *KanbanStep) Delete(ctx context.Context, db DB) error

Delete deletes the KanbanStep from the database.

func (*KanbanStep) FKProject_ProjectID

func (ks *KanbanStep) FKProject_ProjectID(ctx context.Context, db DB) (*Project, error)

FKProject_ProjectID returns the Project associated with the KanbanStep's (ProjectID).

Generated from foreign key 'kanban_steps_project_id_fkey'.

func (*KanbanStep) Insert

func (ks *KanbanStep) Insert(ctx context.Context, db DB) (*KanbanStep, error)

Insert inserts the KanbanStep to the database.

func (*KanbanStep) SetUpdateParams

func (ks *KanbanStep) SetUpdateParams(params *KanbanStepUpdateParams)

SetUpdateParams updates public.kanban_steps struct fields with the specified params.

func (*KanbanStep) Update

func (ks *KanbanStep) Update(ctx context.Context, db DB) (*KanbanStep, error)

Update updates a KanbanStep in the database.

func (*KanbanStep) Upsert

func (ks *KanbanStep) Upsert(ctx context.Context, db DB, params *KanbanStepCreateParams) (*KanbanStep, error)

Upsert upserts a KanbanStep in the database. Requires appropriate PK(s) to be set beforehand.

type KanbanStepCreateParams

type KanbanStepCreateParams struct {
	Color         string    `json:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description   string    `json:"description" required:"true" nullable:"false"`                                        // description
	Name          string    `json:"name" required:"true" nullable:"false"`                                               // name
	ProjectID     ProjectID `json:"projectID" nullable:"false"`                                                          // project_id
	StepOrder     int       `json:"stepOrder" required:"true" nullable:"false"`                                          // step_order
	TimeTrackable bool      `json:"timeTrackable" required:"true" nullable:"false"`                                      // time_trackable
}

KanbanStepCreateParams represents insert params for 'public.kanban_steps'.

type KanbanStepID

type KanbanStepID int

type KanbanStepJoins

type KanbanStepJoins struct {
	Project bool // O2O projects
}

type KanbanStepOrderBy

type KanbanStepOrderBy string

type KanbanStepSelectConfig

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

type KanbanStepSelectConfigOption

type KanbanStepSelectConfigOption func(*KanbanStepSelectConfig)

func WithKanbanStepFilters

func WithKanbanStepFilters(filters map[string][]any) KanbanStepSelectConfigOption

WithKanbanStepFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithKanbanStepJoin

func WithKanbanStepJoin(joins KanbanStepJoins) KanbanStepSelectConfigOption

WithKanbanStepJoin joins with the given tables.

func WithKanbanStepLimit

func WithKanbanStepLimit(limit int) KanbanStepSelectConfigOption

WithKanbanStepLimit limits row selection.

type KanbanStepUpdateParams

type KanbanStepUpdateParams struct {
	Color         *string    `json:"color" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description   *string    `json:"description" nullable:"false"`                                        // description
	Name          *string    `json:"name" nullable:"false"`                                               // name
	ProjectID     *ProjectID `json:"projectID" nullable:"false"`                                          // project_id
	StepOrder     *int       `json:"stepOrder" nullable:"false"`                                          // step_order
	TimeTrackable *bool      `json:"timeTrackable" nullable:"false"`                                      // time_trackable
}

KanbanStepUpdateParams represents update params for 'public.kanban_steps'.

type Movie

type Movie struct {
	MovieID  MovieID `json:"movieID" db:"movie_id" required:"true" nullable:"false"`  // movie_id
	Title    string  `json:"title" db:"title" required:"true" nullable:"false"`       // title
	Year     int     `json:"year" db:"year" required:"true" nullable:"false"`         // year
	Synopsis string  `json:"synopsis" db:"synopsis" required:"true" nullable:"false"` // synopsis

}

Movie represents a row from 'public.movies'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateMovie

func CreateMovie(ctx context.Context, db DB, params *MovieCreateParams) (*Movie, error)

CreateMovie creates a new Movie in the database with the given params.

func MovieByMovieID

func MovieByMovieID(ctx context.Context, db DB, movieID MovieID, opts ...MovieSelectConfigOption) (*Movie, error)

MovieByMovieID retrieves a row from 'public.movies' as a Movie.

Generated from index 'movies_pkey'.

func MoviePaginatedByMovieIDAsc

func MoviePaginatedByMovieIDAsc(ctx context.Context, db DB, movieID MovieID, opts ...MovieSelectConfigOption) ([]Movie, error)

MoviePaginatedByMovieIDAsc returns a cursor-paginated list of Movie in Asc order.

func MoviePaginatedByMovieIDDesc

func MoviePaginatedByMovieIDDesc(ctx context.Context, db DB, movieID MovieID, opts ...MovieSelectConfigOption) ([]Movie, error)

MoviePaginatedByMovieIDDesc returns a cursor-paginated list of Movie in Desc order.

func (*Movie) Delete

func (m *Movie) Delete(ctx context.Context, db DB) error

Delete deletes the Movie from the database.

func (*Movie) Insert

func (m *Movie) Insert(ctx context.Context, db DB) (*Movie, error)

Insert inserts the Movie to the database.

func (*Movie) SetUpdateParams

func (m *Movie) SetUpdateParams(params *MovieUpdateParams)

SetUpdateParams updates public.movies struct fields with the specified params.

func (*Movie) Update

func (m *Movie) Update(ctx context.Context, db DB) (*Movie, error)

Update updates a Movie in the database.

func (*Movie) Upsert

func (m *Movie) Upsert(ctx context.Context, db DB, params *MovieCreateParams) (*Movie, error)

Upsert upserts a Movie in the database. Requires appropriate PK(s) to be set beforehand.

type MovieCreateParams

type MovieCreateParams struct {
	Synopsis string `json:"synopsis" required:"true" nullable:"false"` // synopsis
	Title    string `json:"title" required:"true" nullable:"false"`    // title
	Year     int    `json:"year" required:"true" nullable:"false"`     // year
}

MovieCreateParams represents insert params for 'public.movies'.

type MovieID

type MovieID int

type MovieJoins

type MovieJoins struct {
}

type MovieOrderBy

type MovieOrderBy string

type MovieSelectConfig

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

type MovieSelectConfigOption

type MovieSelectConfigOption func(*MovieSelectConfig)

func WithMovieFilters

func WithMovieFilters(filters map[string][]any) MovieSelectConfigOption

WithMovieFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithMovieJoin

func WithMovieJoin(joins MovieJoins) MovieSelectConfigOption

WithMovieJoin joins with the given tables.

func WithMovieLimit

func WithMovieLimit(limit int) MovieSelectConfigOption

WithMovieLimit limits row selection.

type MovieUpdateParams

type MovieUpdateParams struct {
	Synopsis *string `json:"synopsis" nullable:"false"` // synopsis
	Title    *string `json:"title" nullable:"false"`    // title
	Year     *int    `json:"year" nullable:"false"`     // year
}

MovieUpdateParams represents update params for 'public.movies'.

type Notification

type Notification struct {
	NotificationID   NotificationID   `json:"notificationID" db:"notification_id" required:"true" nullable:"false"`                                                 // notification_id
	ReceiverRank     *int             `json:"receiverRank" db:"receiver_rank"`                                                                                      // receiver_rank
	Title            string           `json:"title" db:"title" required:"true" nullable:"false"`                                                                    // title
	Body             string           `json:"body" db:"body" required:"true" nullable:"false"`                                                                      // body
	Labels           []string         `json:"labels" db:"labels" required:"true" nullable:"false"`                                                                  // labels
	Link             *string          `json:"link" db:"link"`                                                                                                       // link
	CreatedAt        time.Time        `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                                                           // created_at
	Sender           UserID           `json:"sender" db:"sender" required:"true" nullable:"false"`                                                                  // sender
	Receiver         *UserID          `json:"receiver" db:"receiver"`                                                                                               // receiver
	NotificationType NotificationType `json:"notificationType" db:"notification_type" required:"true" nullable:"false" ref:"#/components/schemas/NotificationType"` // notification_type

	ReceiverJoin                      *User               `json:"-" db:"user_receiver" openapi-go:"ignore"`      // O2O users (generated from M2O)
	SenderJoin                        *User               `json:"-" db:"user_sender" openapi-go:"ignore"`        // O2O users (generated from M2O)
	NotificationUserNotificationsJoin *[]UserNotification `json:"-" db:"user_notifications" openapi-go:"ignore"` // M2O notifications

}

Notification represents a row from 'public.notifications'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateNotification

func CreateNotification(ctx context.Context, db DB, params *NotificationCreateParams) (*Notification, error)

CreateNotification creates a new Notification in the database with the given params.

func NotificationByNotificationID

func NotificationByNotificationID(ctx context.Context, db DB, notificationID NotificationID, opts ...NotificationSelectConfigOption) (*Notification, error)

NotificationByNotificationID retrieves a row from 'public.notifications' as a Notification.

Generated from index 'notifications_pkey'.

func NotificationPaginatedByNotificationIDAsc

func NotificationPaginatedByNotificationIDAsc(ctx context.Context, db DB, notificationID NotificationID, opts ...NotificationSelectConfigOption) ([]Notification, error)

NotificationPaginatedByNotificationIDAsc returns a cursor-paginated list of Notification in Asc order.

func NotificationPaginatedByNotificationIDDesc

func NotificationPaginatedByNotificationIDDesc(ctx context.Context, db DB, notificationID NotificationID, opts ...NotificationSelectConfigOption) ([]Notification, error)

NotificationPaginatedByNotificationIDDesc returns a cursor-paginated list of Notification in Desc order.

func NotificationsByReceiverRankNotificationTypeCreatedAt

func NotificationsByReceiverRankNotificationTypeCreatedAt(ctx context.Context, db DB, receiverRank *int, notificationType NotificationType, createdAt time.Time, opts ...NotificationSelectConfigOption) ([]Notification, error)

NotificationsByReceiverRankNotificationTypeCreatedAt retrieves a row from 'public.notifications' as a Notification.

Generated from index 'notifications_receiver_rank_notification_type_created_at_idx'.

func (*Notification) Delete

func (n *Notification) Delete(ctx context.Context, db DB) error

Delete deletes the Notification from the database.

func (*Notification) FKUser_Receiver

func (n *Notification) FKUser_Receiver(ctx context.Context, db DB) (*User, error)

FKUser_Receiver returns the User associated with the Notification's (Receiver).

Generated from foreign key 'notifications_receiver_fkey'.

func (*Notification) FKUser_Sender

func (n *Notification) FKUser_Sender(ctx context.Context, db DB) (*User, error)

FKUser_Sender returns the User associated with the Notification's (Sender).

Generated from foreign key 'notifications_sender_fkey'.

func (*Notification) Insert

func (n *Notification) Insert(ctx context.Context, db DB) (*Notification, error)

Insert inserts the Notification to the database.

func (*Notification) SetUpdateParams

func (n *Notification) SetUpdateParams(params *NotificationUpdateParams)

SetUpdateParams updates public.notifications struct fields with the specified params.

func (*Notification) Update

func (n *Notification) Update(ctx context.Context, db DB) (*Notification, error)

Update updates a Notification in the database.

func (*Notification) Upsert

func (n *Notification) Upsert(ctx context.Context, db DB, params *NotificationCreateParams) (*Notification, error)

Upsert upserts a Notification in the database. Requires appropriate PK(s) to be set beforehand.

type NotificationCreateParams

type NotificationCreateParams struct {
	Body             string           `json:"body" required:"true" nullable:"false"`                                                         // body
	Labels           []string         `json:"labels" required:"true" nullable:"false"`                                                       // labels
	Link             *string          `json:"link"`                                                                                          // link
	NotificationType NotificationType `json:"notificationType" required:"true" nullable:"false" ref:"#/components/schemas/NotificationType"` // notification_type
	Receiver         *UserID          `json:"receiver"`                                                                                      // receiver
	ReceiverRank     *int             `json:"receiverRank"`                                                                                  // receiver_rank
	Sender           UserID           `json:"sender" required:"true" nullable:"false"`                                                       // sender
	Title            string           `json:"title" required:"true" nullable:"false"`                                                        // title
}

NotificationCreateParams represents insert params for 'public.notifications'.

type NotificationID

type NotificationID int

type NotificationJoins

type NotificationJoins struct {
	UserReceiver      bool // O2O users
	UserSender        bool // O2O users
	UserNotifications bool // M2O user_notifications
}

type NotificationOrderBy

type NotificationOrderBy string
const (
	NotificationCreatedAtDescNullsFirst NotificationOrderBy = " created_at DESC NULLS FIRST "
	NotificationCreatedAtDescNullsLast  NotificationOrderBy = " created_at DESC NULLS LAST "
	NotificationCreatedAtAscNullsFirst  NotificationOrderBy = " created_at ASC NULLS FIRST "
	NotificationCreatedAtAscNullsLast   NotificationOrderBy = " created_at ASC NULLS LAST "
)

type NotificationSelectConfig

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

type NotificationSelectConfigOption

type NotificationSelectConfigOption func(*NotificationSelectConfig)

func WithNotificationFilters

func WithNotificationFilters(filters map[string][]any) NotificationSelectConfigOption

WithNotificationFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithNotificationJoin

func WithNotificationJoin(joins NotificationJoins) NotificationSelectConfigOption

WithNotificationJoin joins with the given tables.

func WithNotificationLimit

func WithNotificationLimit(limit int) NotificationSelectConfigOption

WithNotificationLimit limits row selection.

func WithNotificationOrderBy

func WithNotificationOrderBy(rows ...NotificationOrderBy) NotificationSelectConfigOption

WithNotificationOrderBy orders results by the given columns.

type NotificationType

type NotificationType string

NotificationType is the 'notification_type' enum type from schema 'public'.

const (
	// NotificationTypePersonal is the 'personal' notification_type.
	NotificationTypePersonal NotificationType = "personal"
	// NotificationTypeGlobal is the 'global' notification_type.
	NotificationTypeGlobal NotificationType = "global"
)

NotificationType values.

func AllNotificationTypeValues

func AllNotificationTypeValues() []NotificationType

func (*NotificationType) Scan

func (nt *NotificationType) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface.

func (NotificationType) Value

func (nt NotificationType) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type NotificationUpdateParams

type NotificationUpdateParams struct {
	Body             *string           `json:"body" nullable:"false"`                                                         // body
	Labels           *[]string         `json:"labels" nullable:"false"`                                                       // labels
	Link             **string          `json:"link"`                                                                          // link
	NotificationType *NotificationType `json:"notificationType" nullable:"false" ref:"#/components/schemas/NotificationType"` // notification_type
	Receiver         **UserID          `json:"receiver"`                                                                      // receiver
	ReceiverRank     **int             `json:"receiverRank"`                                                                  // receiver_rank
	Sender           *UserID           `json:"sender" nullable:"false"`                                                       // sender
	Title            *string           `json:"title" nullable:"false"`                                                        // title
}

NotificationUpdateParams represents update params for 'public.notifications'.

type NullNotificationType

type NullNotificationType struct {
	NotificationType NotificationType
	// Valid is true if NotificationType is not null.
	Valid bool
}

NullNotificationType represents a null 'notification_type' enum for schema 'public'.

func (*NullNotificationType) Scan

func (nnt *NullNotificationType) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (NullNotificationType) Value

func (nnt NullNotificationType) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type NullWorkItemRole

type NullWorkItemRole struct {
	WorkItemRole WorkItemRole
	// Valid is true if WorkItemRole is not null.
	Valid bool
}

NullWorkItemRole represents a null 'work_item_role' enum for schema 'public'.

func (*NullWorkItemRole) Scan

func (nwir *NullWorkItemRole) Scan(v interface{}) error

Scan satisfies the sql.Scanner interface.

func (NullWorkItemRole) Value

func (nwir NullWorkItemRole) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type Project

type Project struct {
	ProjectID          ProjectID            `json:"projectID" db:"project_id" required:"true" nullable:"false"`                                              // project_id
	Name               models.Project       `json:"name" db:"name" required:"true" nullable:"false" ref:"#/components/schemas/Project"`                      // name
	Description        string               `json:"description" db:"description" required:"true" nullable:"false"`                                           // description
	WorkItemsTableName string               `json:"-" db:"work_items_table_name" nullable:"false"`                                                           // work_items_table_name
	BoardConfig        models.ProjectConfig `json:"boardConfig" db:"board_config" required:"true" nullable:"false" ref:"#/components/schemas/ProjectConfig"` // board_config
	CreatedAt          time.Time            `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                                              // created_at
	UpdatedAt          time.Time            `json:"updatedAt" db:"updated_at" required:"true" nullable:"false"`                                              // updated_at

	ProjectActivitiesJoin    *[]Activity     `json:"-" db:"activities" openapi-go:"ignore"`      // M2O projects
	ProjectKanbanStepsJoin   *[]KanbanStep   `json:"-" db:"kanban_steps" openapi-go:"ignore"`    // M2O projects
	ProjectTeamsJoin         *[]Team         `json:"-" db:"teams" openapi-go:"ignore"`           // M2O projects
	ProjectWorkItemTagsJoin  *[]WorkItemTag  `json:"-" db:"work_item_tags" openapi-go:"ignore"`  // M2O projects
	ProjectWorkItemTypesJoin *[]WorkItemType `json:"-" db:"work_item_types" openapi-go:"ignore"` // M2O projects

}

Project represents a row from 'public.projects'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateProject

func CreateProject(ctx context.Context, db DB, params *ProjectCreateParams) (*Project, error)

CreateProject creates a new Project in the database with the given params.

func ProjectByName

func ProjectByName(ctx context.Context, db DB, name models.Project, opts ...ProjectSelectConfigOption) (*Project, error)

ProjectByName retrieves a row from 'public.projects' as a Project.

Generated from index 'projects_name_key'.

func ProjectByProjectID

func ProjectByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...ProjectSelectConfigOption) (*Project, error)

ProjectByProjectID retrieves a row from 'public.projects' as a Project.

Generated from index 'projects_pkey'.

func ProjectByWorkItemsTableName

func ProjectByWorkItemsTableName(ctx context.Context, db DB, workItemsTableName string, opts ...ProjectSelectConfigOption) (*Project, error)

ProjectByWorkItemsTableName retrieves a row from 'public.projects' as a Project.

Generated from index 'projects_work_items_table_name_key'.

func ProjectPaginatedByProjectIDAsc

func ProjectPaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...ProjectSelectConfigOption) ([]Project, error)

ProjectPaginatedByProjectIDAsc returns a cursor-paginated list of Project in Asc order.

func ProjectPaginatedByProjectIDDesc

func ProjectPaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...ProjectSelectConfigOption) ([]Project, error)

ProjectPaginatedByProjectIDDesc returns a cursor-paginated list of Project in Desc order.

func (*Project) Delete

func (p *Project) Delete(ctx context.Context, db DB) error

Delete deletes the Project from the database.

func (*Project) Insert

func (p *Project) Insert(ctx context.Context, db DB) (*Project, error)

Insert inserts the Project to the database.

func (*Project) SetUpdateParams

func (p *Project) SetUpdateParams(params *ProjectUpdateParams)

SetUpdateParams updates public.projects struct fields with the specified params.

func (*Project) Update

func (p *Project) Update(ctx context.Context, db DB) (*Project, error)

Update updates a Project in the database.

func (*Project) Upsert

func (p *Project) Upsert(ctx context.Context, db DB, params *ProjectCreateParams) (*Project, error)

Upsert upserts a Project in the database. Requires appropriate PK(s) to be set beforehand.

type ProjectCreateParams

type ProjectCreateParams struct {
	BoardConfig        models.ProjectConfig `json:"boardConfig" required:"true" nullable:"false" ref:"#/components/schemas/ProjectConfig"` // board_config
	Description        string               `json:"description" required:"true" nullable:"false"`                                          // description
	Name               models.Project       `json:"name" required:"true" nullable:"false" ref:"#/components/schemas/Project"`              // name
	WorkItemsTableName string               `json:"-" nullable:"false"`                                                                    // work_items_table_name
}

ProjectCreateParams represents insert params for 'public.projects'.

type ProjectID

type ProjectID int

type ProjectJoins

type ProjectJoins struct {
	Activities    bool // M2O activities
	KanbanSteps   bool // M2O kanban_steps
	Teams         bool // M2O teams
	WorkItemTags  bool // M2O work_item_tags
	WorkItemTypes bool // M2O work_item_types
}

type ProjectOrderBy

type ProjectOrderBy string
const (
	ProjectCreatedAtDescNullsFirst ProjectOrderBy = " created_at DESC NULLS FIRST "
	ProjectCreatedAtDescNullsLast  ProjectOrderBy = " created_at DESC NULLS LAST "
	ProjectCreatedAtAscNullsFirst  ProjectOrderBy = " created_at ASC NULLS FIRST "
	ProjectCreatedAtAscNullsLast   ProjectOrderBy = " created_at ASC NULLS LAST "
	ProjectUpdatedAtDescNullsFirst ProjectOrderBy = " updated_at DESC NULLS FIRST "
	ProjectUpdatedAtDescNullsLast  ProjectOrderBy = " updated_at DESC NULLS LAST "
	ProjectUpdatedAtAscNullsFirst  ProjectOrderBy = " updated_at ASC NULLS FIRST "
	ProjectUpdatedAtAscNullsLast   ProjectOrderBy = " updated_at ASC NULLS LAST "
)

type ProjectSelectConfig

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

type ProjectSelectConfigOption

type ProjectSelectConfigOption func(*ProjectSelectConfig)

func WithProjectFilters

func WithProjectFilters(filters map[string][]any) ProjectSelectConfigOption

WithProjectFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithProjectJoin

func WithProjectJoin(joins ProjectJoins) ProjectSelectConfigOption

WithProjectJoin joins with the given tables.

func WithProjectLimit

func WithProjectLimit(limit int) ProjectSelectConfigOption

WithProjectLimit limits row selection.

func WithProjectOrderBy

func WithProjectOrderBy(rows ...ProjectOrderBy) ProjectSelectConfigOption

WithProjectOrderBy orders results by the given columns.

type ProjectUpdateParams

type ProjectUpdateParams struct {
	BoardConfig        *models.ProjectConfig `json:"boardConfig" nullable:"false" ref:"#/components/schemas/ProjectConfig"` // board_config
	Description        *string               `json:"description" nullable:"false"`                                          // description
	Name               *models.Project       `json:"name" nullable:"false" ref:"#/components/schemas/Project"`              // name
	WorkItemsTableName *string               `json:"-" nullable:"false"`                                                    // work_items_table_name
}

ProjectUpdateParams represents update params for 'public.projects'.

type Querier

type Querier interface {
	GetUser(ctx context.Context, db DBTX, arg GetUserParams) (GetUserRow, error)
	GetUserNotifications(ctx context.Context, db DBTX, arg GetUserNotificationsParams) ([]GetUserNotificationsRow, error)
	// plpgsql-language-server:disable
	RegisterNewUser(ctx context.Context, db DBTX, arg RegisterNewUserParams) (RegisterNewUserRow, error)
	// update
	//   users
	// set
	//   username = null
	//   , email = COALESCE(LOWER(sqlc.narg('email')) , email)
	// where
	//   user_id = @user_id;
	Test(ctx context.Context, db DBTX) error
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, db DBTX, arg GetUserParams) (GetUserRow, error)

func (*Queries) GetUserNotifications

func (q *Queries) GetUserNotifications(ctx context.Context, db DBTX, arg GetUserNotificationsParams) ([]GetUserNotificationsRow, error)

func (*Queries) RegisterNewUser

func (q *Queries) RegisterNewUser(ctx context.Context, db DBTX, arg RegisterNewUserParams) (RegisterNewUserRow, error)

plpgsql-language-server:disable

func (*Queries) Test

func (q *Queries) Test(ctx context.Context, db DBTX) error

update

users

set

username = null
, email = COALESCE(LOWER(sqlc.narg('email')) , email)

where

user_id = @user_id;

type RegisterNewUserParams

type RegisterNewUserParams struct {
	Username string `db:"username" json:"username"`
	Email    string `db:"email" json:"email"`
	RoleRank int16  `db:"role_rank" json:"role_rank"`
}

type RegisterNewUserRow

type RegisterNewUserRow struct {
	UserID    uuid.UUID `db:"user_id" json:"user_id"`
	Username  string    `db:"username" json:"username"`
	Email     string    `db:"email" json:"email"`
	RoleRank  int16     `db:"role_rank" json:"role_rank"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

type SchemaMigration

type SchemaMigration struct {
	Version SchemaMigrationID `json:"version" db:"version" required:"true" nullable:"false"` // version
	Dirty   bool              `json:"dirty" db:"dirty" required:"true" nullable:"false"`     // dirty

}

SchemaMigration represents a row from 'public.schema_migrations'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateSchemaMigration

func CreateSchemaMigration(ctx context.Context, db DB, params *SchemaMigrationCreateParams) (*SchemaMigration, error)

CreateSchemaMigration creates a new SchemaMigration in the database with the given params.

func SchemaMigrationByVersion

func SchemaMigrationByVersion(ctx context.Context, db DB, version SchemaMigrationID, opts ...SchemaMigrationSelectConfigOption) (*SchemaMigration, error)

SchemaMigrationByVersion retrieves a row from 'public.schema_migrations' as a SchemaMigration.

Generated from index 'schema_migrations_pkey'.

func SchemaMigrationPaginatedByVersionAsc

func SchemaMigrationPaginatedByVersionAsc(ctx context.Context, db DB, version SchemaMigrationID, opts ...SchemaMigrationSelectConfigOption) ([]SchemaMigration, error)

SchemaMigrationPaginatedByVersionAsc returns a cursor-paginated list of SchemaMigration in Asc order.

func SchemaMigrationPaginatedByVersionDesc

func SchemaMigrationPaginatedByVersionDesc(ctx context.Context, db DB, version SchemaMigrationID, opts ...SchemaMigrationSelectConfigOption) ([]SchemaMigration, error)

SchemaMigrationPaginatedByVersionDesc returns a cursor-paginated list of SchemaMigration in Desc order.

func (*SchemaMigration) Delete

func (sm *SchemaMigration) Delete(ctx context.Context, db DB) error

Delete deletes the SchemaMigration from the database.

func (*SchemaMigration) Insert

func (sm *SchemaMigration) Insert(ctx context.Context, db DB) (*SchemaMigration, error)

Insert inserts the SchemaMigration to the database.

func (*SchemaMigration) SetUpdateParams

func (sm *SchemaMigration) SetUpdateParams(params *SchemaMigrationUpdateParams)

SetUpdateParams updates public.schema_migrations struct fields with the specified params.

func (*SchemaMigration) Update

func (sm *SchemaMigration) Update(ctx context.Context, db DB) (*SchemaMigration, error)

Update updates a SchemaMigration in the database.

func (*SchemaMigration) Upsert

Upsert upserts a SchemaMigration in the database. Requires appropriate PK(s) to be set beforehand.

type SchemaMigrationCreateParams

type SchemaMigrationCreateParams struct {
	Dirty   bool              `json:"dirty" required:"true" nullable:"false"`   // dirty
	Version SchemaMigrationID `json:"version" required:"true" nullable:"false"` // version
}

SchemaMigrationCreateParams represents insert params for 'public.schema_migrations'.

type SchemaMigrationID

type SchemaMigrationID int

type SchemaMigrationJoins

type SchemaMigrationJoins struct {
}

type SchemaMigrationOrderBy

type SchemaMigrationOrderBy string

type SchemaMigrationSelectConfig

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

type SchemaMigrationSelectConfigOption

type SchemaMigrationSelectConfigOption func(*SchemaMigrationSelectConfig)

func WithSchemaMigrationFilters

func WithSchemaMigrationFilters(filters map[string][]any) SchemaMigrationSelectConfigOption

WithSchemaMigrationFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithSchemaMigrationJoin

func WithSchemaMigrationJoin(joins SchemaMigrationJoins) SchemaMigrationSelectConfigOption

WithSchemaMigrationJoin joins with the given tables.

func WithSchemaMigrationLimit

func WithSchemaMigrationLimit(limit int) SchemaMigrationSelectConfigOption

WithSchemaMigrationLimit limits row selection.

type SchemaMigrationUpdateParams

type SchemaMigrationUpdateParams struct {
	Dirty   *bool              `json:"dirty" nullable:"false"`   // dirty
	Version *SchemaMigrationID `json:"version" nullable:"false"` // version
}

SchemaMigrationUpdateParams represents update params for 'public.schema_migrations'.

type Team

type Team struct {
	TeamID      TeamID    `json:"teamID" db:"team_id" required:"true" nullable:"false"`          // team_id
	ProjectID   ProjectID `json:"projectID" db:"project_id" required:"true" nullable:"false"`    // project_id
	Name        string    `json:"name" db:"name" required:"true" nullable:"false"`               // name
	Description string    `json:"description" db:"description" required:"true" nullable:"false"` // description
	CreatedAt   time.Time `json:"createdAt" db:"created_at" required:"true" nullable:"false"`    // created_at
	UpdatedAt   time.Time `json:"updatedAt" db:"updated_at" required:"true" nullable:"false"`    // updated_at

	ProjectJoin         *Project     `json:"-" db:"project_project_id" openapi-go:"ignore"` // O2O projects (generated from M2O)
	TeamTimeEntriesJoin *[]TimeEntry `json:"-" db:"time_entries" openapi-go:"ignore"`       // M2O teams
	TeamMembersJoin     *[]User      `json:"-" db:"user_team_members" openapi-go:"ignore"`  // M2M user_team

}

Team represents a row from 'public.teams'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateTeam

func CreateTeam(ctx context.Context, db DB, params *TeamCreateParams) (*Team, error)

CreateTeam creates a new Team in the database with the given params.

func TeamByNameProjectID

func TeamByNameProjectID(ctx context.Context, db DB, name string, projectID ProjectID, opts ...TeamSelectConfigOption) (*Team, error)

TeamByNameProjectID retrieves a row from 'public.teams' as a Team.

Generated from index 'teams_name_project_id_key'.

func TeamByTeamID

func TeamByTeamID(ctx context.Context, db DB, teamID TeamID, opts ...TeamSelectConfigOption) (*Team, error)

TeamByTeamID retrieves a row from 'public.teams' as a Team.

Generated from index 'teams_pkey'.

func TeamPaginatedByProjectIDAsc

func TeamPaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...TeamSelectConfigOption) ([]Team, error)

TeamPaginatedByProjectIDAsc returns a cursor-paginated list of Team in Asc order.

func TeamPaginatedByProjectIDDesc

func TeamPaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...TeamSelectConfigOption) ([]Team, error)

TeamPaginatedByProjectIDDesc returns a cursor-paginated list of Team in Desc order.

func TeamPaginatedByTeamIDAsc

func TeamPaginatedByTeamIDAsc(ctx context.Context, db DB, teamID TeamID, opts ...TeamSelectConfigOption) ([]Team, error)

TeamPaginatedByTeamIDAsc returns a cursor-paginated list of Team in Asc order.

func TeamPaginatedByTeamIDDesc

func TeamPaginatedByTeamIDDesc(ctx context.Context, db DB, teamID TeamID, opts ...TeamSelectConfigOption) ([]Team, error)

TeamPaginatedByTeamIDDesc returns a cursor-paginated list of Team in Desc order.

func TeamsByName

func TeamsByName(ctx context.Context, db DB, name string, opts ...TeamSelectConfigOption) ([]Team, error)

TeamsByName retrieves a row from 'public.teams' as a Team.

Generated from index 'teams_name_project_id_key'.

func TeamsByProjectID

func TeamsByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...TeamSelectConfigOption) ([]Team, error)

TeamsByProjectID retrieves a row from 'public.teams' as a Team.

Generated from index 'teams_name_project_id_key'.

func (*Team) Delete

func (t *Team) Delete(ctx context.Context, db DB) error

Delete deletes the Team from the database.

func (*Team) FKProject_ProjectID

func (t *Team) FKProject_ProjectID(ctx context.Context, db DB) (*Project, error)

FKProject_ProjectID returns the Project associated with the Team's (ProjectID).

Generated from foreign key 'teams_project_id_fkey'.

func (*Team) Insert

func (t *Team) Insert(ctx context.Context, db DB) (*Team, error)

Insert inserts the Team to the database.

func (*Team) SetUpdateParams

func (t *Team) SetUpdateParams(params *TeamUpdateParams)

SetUpdateParams updates public.teams struct fields with the specified params.

func (*Team) Update

func (t *Team) Update(ctx context.Context, db DB) (*Team, error)

Update updates a Team in the database.

func (*Team) Upsert

func (t *Team) Upsert(ctx context.Context, db DB, params *TeamCreateParams) (*Team, error)

Upsert upserts a Team in the database. Requires appropriate PK(s) to be set beforehand.

type TeamCreateParams

type TeamCreateParams struct {
	Description string    `json:"description" required:"true" nullable:"false"` // description
	Name        string    `json:"name" required:"true" nullable:"false"`        // name
	ProjectID   ProjectID `json:"projectID" required:"true" nullable:"false"`   // project_id
}

TeamCreateParams represents insert params for 'public.teams'.

type TeamID

type TeamID int

type TeamJoins

type TeamJoins struct {
	Project     bool // O2O projects
	TimeEntries bool // M2O time_entries
	Members     bool // M2M user_team
}

type TeamOrderBy

type TeamOrderBy string
const (
	TeamCreatedAtDescNullsFirst TeamOrderBy = " created_at DESC NULLS FIRST "
	TeamCreatedAtDescNullsLast  TeamOrderBy = " created_at DESC NULLS LAST "
	TeamCreatedAtAscNullsFirst  TeamOrderBy = " created_at ASC NULLS FIRST "
	TeamCreatedAtAscNullsLast   TeamOrderBy = " created_at ASC NULLS LAST "
	TeamUpdatedAtDescNullsFirst TeamOrderBy = " updated_at DESC NULLS FIRST "
	TeamUpdatedAtDescNullsLast  TeamOrderBy = " updated_at DESC NULLS LAST "
	TeamUpdatedAtAscNullsFirst  TeamOrderBy = " updated_at ASC NULLS FIRST "
	TeamUpdatedAtAscNullsLast   TeamOrderBy = " updated_at ASC NULLS LAST "
)

type TeamSelectConfig

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

type TeamSelectConfigOption

type TeamSelectConfigOption func(*TeamSelectConfig)

func WithTeamFilters

func WithTeamFilters(filters map[string][]any) TeamSelectConfigOption

WithTeamFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithTeamJoin

func WithTeamJoin(joins TeamJoins) TeamSelectConfigOption

WithTeamJoin joins with the given tables.

func WithTeamLimit

func WithTeamLimit(limit int) TeamSelectConfigOption

WithTeamLimit limits row selection.

func WithTeamOrderBy

func WithTeamOrderBy(rows ...TeamOrderBy) TeamSelectConfigOption

WithTeamOrderBy orders results by the given columns.

type TeamUpdateParams

type TeamUpdateParams struct {
	Description *string    `json:"description" nullable:"false"` // description
	Name        *string    `json:"name" nullable:"false"`        // name
	ProjectID   *ProjectID `json:"projectID" nullable:"false"`   // project_id
}

TeamUpdateParams represents update params for 'public.teams'.

type TestRow

type TestRow struct {
	UserID    uuid.UUID `db:"user_id" json:"user_id"`
	Username  string    `db:"username" json:"username"`
	Email     string    `db:"email" json:"email"`
	RoleRank  int16     `db:"role_rank" json:"role_rank"`
	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

type TimeEntry

type TimeEntry struct {
	TimeEntryID     TimeEntryID `json:"timeEntryID" db:"time_entry_id" required:"true" nullable:"false"` // time_entry_id
	WorkItemID      *WorkItemID `json:"workItemID" db:"work_item_id"`                                    // work_item_id
	ActivityID      ActivityID  `json:"activityID" db:"activity_id" required:"true" nullable:"false"`    // activity_id
	TeamID          *TeamID     `json:"teamID" db:"team_id"`                                             // team_id
	UserID          UserID      `json:"userID" db:"user_id" required:"true" nullable:"false"`            // user_id
	Comment         string      `json:"comment" db:"comment" required:"true" nullable:"false"`           // comment
	Start           time.Time   `json:"start" db:"start" required:"true" nullable:"false"`               // start
	DurationMinutes *int        `json:"durationMinutes" db:"duration_minutes"`                           // duration_minutes

	ActivityJoin *Activity `json:"-" db:"activity_activity_id" openapi-go:"ignore"`   // O2O activities (generated from M2O)
	TeamJoin     *Team     `json:"-" db:"team_team_id" openapi-go:"ignore"`           // O2O teams (generated from M2O)
	UserJoin     *User     `json:"-" db:"user_user_id" openapi-go:"ignore"`           // O2O users (generated from M2O)
	WorkItemJoin *WorkItem `json:"-" db:"work_item_work_item_id" openapi-go:"ignore"` // O2O work_items (generated from M2O)

}

TimeEntry represents a row from 'public.time_entries'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateTimeEntry

func CreateTimeEntry(ctx context.Context, db DB, params *TimeEntryCreateParams) (*TimeEntry, error)

CreateTimeEntry creates a new TimeEntry in the database with the given params.

func TimeEntriesByUserIDTeamID

func TimeEntriesByUserIDTeamID(ctx context.Context, db DB, userID UserID, teamID TeamID, opts ...TimeEntrySelectConfigOption) ([]TimeEntry, error)

TimeEntriesByUserIDTeamID retrieves a row from 'public.time_entries' as a TimeEntry.

Generated from index 'time_entries_user_id_team_id_idx'.

func TimeEntriesByWorkItemIDTeamID

func TimeEntriesByWorkItemIDTeamID(ctx context.Context, db DB, workItemID WorkItemID, teamID TeamID, opts ...TimeEntrySelectConfigOption) ([]TimeEntry, error)

TimeEntriesByWorkItemIDTeamID retrieves a row from 'public.time_entries' as a TimeEntry.

Generated from index 'time_entries_work_item_id_team_id_idx'.

func TimeEntryByTimeEntryID

func TimeEntryByTimeEntryID(ctx context.Context, db DB, timeEntryID TimeEntryID, opts ...TimeEntrySelectConfigOption) (*TimeEntry, error)

TimeEntryByTimeEntryID retrieves a row from 'public.time_entries' as a TimeEntry.

Generated from index 'time_entries_pkey'.

func TimeEntryPaginatedByTimeEntryIDAsc

func TimeEntryPaginatedByTimeEntryIDAsc(ctx context.Context, db DB, timeEntryID TimeEntryID, opts ...TimeEntrySelectConfigOption) ([]TimeEntry, error)

TimeEntryPaginatedByTimeEntryIDAsc returns a cursor-paginated list of TimeEntry in Asc order.

func TimeEntryPaginatedByTimeEntryIDDesc

func TimeEntryPaginatedByTimeEntryIDDesc(ctx context.Context, db DB, timeEntryID TimeEntryID, opts ...TimeEntrySelectConfigOption) ([]TimeEntry, error)

TimeEntryPaginatedByTimeEntryIDDesc returns a cursor-paginated list of TimeEntry in Desc order.

func (*TimeEntry) Delete

func (te *TimeEntry) Delete(ctx context.Context, db DB) error

Delete deletes the TimeEntry from the database.

func (*TimeEntry) FKActivity_ActivityID

func (te *TimeEntry) FKActivity_ActivityID(ctx context.Context, db DB) (*Activity, error)

FKActivity_ActivityID returns the Activity associated with the TimeEntry's (ActivityID).

Generated from foreign key 'time_entries_activity_id_fkey'.

func (*TimeEntry) FKTeam_TeamID

func (te *TimeEntry) FKTeam_TeamID(ctx context.Context, db DB) (*Team, error)

FKTeam_TeamID returns the Team associated with the TimeEntry's (TeamID).

Generated from foreign key 'time_entries_team_id_fkey'.

func (*TimeEntry) FKUser_UserID

func (te *TimeEntry) FKUser_UserID(ctx context.Context, db DB) (*User, error)

FKUser_UserID returns the User associated with the TimeEntry's (UserID).

Generated from foreign key 'time_entries_user_id_fkey'.

func (*TimeEntry) FKWorkItem_WorkItemID

func (te *TimeEntry) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the TimeEntry's (WorkItemID).

Generated from foreign key 'time_entries_work_item_id_fkey'.

func (*TimeEntry) Insert

func (te *TimeEntry) Insert(ctx context.Context, db DB) (*TimeEntry, error)

Insert inserts the TimeEntry to the database.

func (*TimeEntry) SetUpdateParams

func (te *TimeEntry) SetUpdateParams(params *TimeEntryUpdateParams)

SetUpdateParams updates public.time_entries struct fields with the specified params.

func (*TimeEntry) Update

func (te *TimeEntry) Update(ctx context.Context, db DB) (*TimeEntry, error)

Update updates a TimeEntry in the database.

func (*TimeEntry) Upsert

func (te *TimeEntry) Upsert(ctx context.Context, db DB, params *TimeEntryCreateParams) (*TimeEntry, error)

Upsert upserts a TimeEntry in the database. Requires appropriate PK(s) to be set beforehand.

type TimeEntryCreateParams

type TimeEntryCreateParams struct {
	ActivityID      ActivityID  `json:"activityID" required:"true" nullable:"false"` // activity_id
	Comment         string      `json:"comment" required:"true" nullable:"false"`    // comment
	DurationMinutes *int        `json:"durationMinutes"`                             // duration_minutes
	Start           time.Time   `json:"start" required:"true" nullable:"false"`      // start
	TeamID          *TeamID     `json:"teamID"`                                      // team_id
	UserID          UserID      `json:"userID" required:"true" nullable:"false"`     // user_id
	WorkItemID      *WorkItemID `json:"workItemID"`                                  // work_item_id
}

TimeEntryCreateParams represents insert params for 'public.time_entries'.

type TimeEntryID

type TimeEntryID int

type TimeEntryJoins

type TimeEntryJoins struct {
	Activity bool // O2O activities
	Team     bool // O2O teams
	User     bool // O2O users
	WorkItem bool // O2O work_items
}

type TimeEntryOrderBy

type TimeEntryOrderBy string
const (
	TimeEntryStartDescNullsFirst TimeEntryOrderBy = " start DESC NULLS FIRST "
	TimeEntryStartDescNullsLast  TimeEntryOrderBy = " start DESC NULLS LAST "
	TimeEntryStartAscNullsFirst  TimeEntryOrderBy = " start ASC NULLS FIRST "
	TimeEntryStartAscNullsLast   TimeEntryOrderBy = " start ASC NULLS LAST "
)

type TimeEntrySelectConfig

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

type TimeEntrySelectConfigOption

type TimeEntrySelectConfigOption func(*TimeEntrySelectConfig)

func WithTimeEntryFilters

func WithTimeEntryFilters(filters map[string][]any) TimeEntrySelectConfigOption

WithTimeEntryFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithTimeEntryJoin

func WithTimeEntryJoin(joins TimeEntryJoins) TimeEntrySelectConfigOption

WithTimeEntryJoin joins with the given tables.

func WithTimeEntryLimit

func WithTimeEntryLimit(limit int) TimeEntrySelectConfigOption

WithTimeEntryLimit limits row selection.

func WithTimeEntryOrderBy

func WithTimeEntryOrderBy(rows ...TimeEntryOrderBy) TimeEntrySelectConfigOption

WithTimeEntryOrderBy orders results by the given columns.

type TimeEntryUpdateParams

type TimeEntryUpdateParams struct {
	ActivityID      *ActivityID  `json:"activityID" nullable:"false"` // activity_id
	Comment         *string      `json:"comment" nullable:"false"`    // comment
	DurationMinutes **int        `json:"durationMinutes"`             // duration_minutes
	Start           *time.Time   `json:"start" nullable:"false"`      // start
	TeamID          **TeamID     `json:"teamID"`                      // team_id
	UserID          *UserID      `json:"userID" nullable:"false"`     // user_id
	WorkItemID      **WorkItemID `json:"workItemID"`                  // work_item_id
}

TimeEntryUpdateParams represents update params for 'public.time_entries'.

type Trigger

type Trigger struct{}

func BeforeUpdateUpdatedAt

func BeforeUpdateUpdatedAt(ctx context.Context, db DB) (Trigger, error)

BeforeUpdateUpdatedAt calls the stored function 'public.before_update_updated_at() trigger' on db.

func NotificationFanOut

func NotificationFanOut(ctx context.Context, db DB) (Trigger, error)

NotificationFanOut calls the stored function 'public.notification_fan_out() trigger' on db.

type User

type User struct {
	UserID                   UserID        `json:"userID" db:"user_id" required:"true" nullable:"false"`                                      // user_id
	Username                 string        `json:"username" db:"username" required:"true" nullable:"false"`                                   // username
	Email                    string        `json:"email" db:"email" required:"true" nullable:"false"`                                         // email
	FirstName                *string       `json:"firstName" db:"first_name"`                                                                 // first_name
	LastName                 *string       `json:"lastName" db:"last_name"`                                                                   // last_name
	FullName                 *string       `json:"fullName" db:"full_name"`                                                                   // full_name
	ExternalID               string        `json:"-" db:"external_id" nullable:"false"`                                                       // external_id
	APIKeyID                 *UserAPIKeyID `json:"-" db:"api_key_id"`                                                                         // api_key_id
	Scopes                   models.Scopes `json:"scopes" db:"scopes" required:"true" nullable:"false" ref:"#/components/schemas/Scopes"`     // scopes
	RoleRank                 int           `json:"-" db:"role_rank" nullable:"false"`                                                         // role_rank
	HasPersonalNotifications bool          `json:"hasPersonalNotifications" db:"has_personal_notifications" required:"true" nullable:"false"` // has_personal_notifications
	HasGlobalNotifications   bool          `json:"hasGlobalNotifications" db:"has_global_notifications" required:"true" nullable:"false"`     // has_global_notifications
	CreatedAt                time.Time     `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                                // created_at
	UpdatedAt                time.Time     `json:"-" db:"updated_at" nullable:"false"`                                                        // updated_at
	DeletedAt                *time.Time    `json:"deletedAt" db:"deleted_at"`                                                                 // deleted_at

	ReceiverNotificationsJoin *[]Notification        `json:"-" db:"notifications_receiver" openapi-go:"ignore"`             // M2O users
	SenderNotificationsJoin   *[]Notification        `json:"-" db:"notifications_sender" openapi-go:"ignore"`               // M2O users
	UserTimeEntriesJoin       *[]TimeEntry           `json:"-" db:"time_entries" openapi-go:"ignore"`                       // M2O users
	UserUserNotificationsJoin *[]UserNotification    `json:"-" db:"user_notifications" openapi-go:"ignore"`                 // M2O users
	MemberTeamsJoin           *[]Team                `json:"-" db:"user_team_teams" openapi-go:"ignore"`                    // M2M user_team
	APIKeyJoin                *UserAPIKey            `json:"-" db:"user_api_key_api_key_id" openapi-go:"ignore"`            // O2O user_api_keys (inferred)
	AssignedUserWorkItemsJoin *[]WorkItem__WIAU_User `json:"-" db:"work_item_assigned_user_work_items" openapi-go:"ignore"` // M2M work_item_assigned_user
	UserWorkItemCommentsJoin  *[]WorkItemComment     `json:"-" db:"work_item_comments" openapi-go:"ignore"`                 // M2O users

}

User represents a row from 'public.users'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateUser

func CreateUser(ctx context.Context, db DB, params *UserCreateParams) (*User, error)

CreateUser creates a new User in the database with the given params.

func UserByCreatedAt

func UserByCreatedAt(ctx context.Context, db DB, createdAt time.Time, opts ...UserSelectConfigOption) (*User, error)

UserByCreatedAt retrieves a row from 'public.users' as a User.

Generated from index 'users_created_at_key'.

func UserByEmail

func UserByEmail(ctx context.Context, db DB, email string, opts ...UserSelectConfigOption) (*User, error)

UserByEmail retrieves a row from 'public.users' as a User.

Generated from index 'users_email_key'.

func UserByExternalID

func UserByExternalID(ctx context.Context, db DB, externalID string, opts ...UserSelectConfigOption) (*User, error)

UserByExternalID retrieves a row from 'public.users' as a User.

Generated from index 'users_external_id_key'.

func UserByUserID

func UserByUserID(ctx context.Context, db DB, userID UserID, opts ...UserSelectConfigOption) (*User, error)

UserByUserID retrieves a row from 'public.users' as a User.

Generated from index 'users_pkey'.

func UserByUsername

func UserByUsername(ctx context.Context, db DB, username string, opts ...UserSelectConfigOption) (*User, error)

UserByUsername retrieves a row from 'public.users' as a User.

Generated from index 'users_username_key'.

func UserPaginatedByCreatedAtAsc

func UserPaginatedByCreatedAtAsc(ctx context.Context, db DB, createdAt time.Time, opts ...UserSelectConfigOption) ([]User, error)

UserPaginatedByCreatedAtAsc returns a cursor-paginated list of User in Asc order.

func UserPaginatedByCreatedAtDesc

func UserPaginatedByCreatedAtDesc(ctx context.Context, db DB, createdAt time.Time, opts ...UserSelectConfigOption) ([]User, error)

UserPaginatedByCreatedAtDesc returns a cursor-paginated list of User in Desc order.

func UsersByDeletedAt_WhereDeletedAtIsNotNull

func UsersByDeletedAt_WhereDeletedAtIsNotNull(ctx context.Context, db DB, deletedAt *time.Time, opts ...UserSelectConfigOption) ([]User, error)

UsersByDeletedAt_WhereDeletedAtIsNotNull retrieves a row from 'public.users' as a User.

Generated from index 'users_deleted_at_idx'.

func UsersByUpdatedAt

func UsersByUpdatedAt(ctx context.Context, db DB, updatedAt time.Time, opts ...UserSelectConfigOption) ([]User, error)

UsersByUpdatedAt retrieves a row from 'public.users' as a User.

Generated from index 'users_updated_at_idx'.

func (*User) Delete

func (u *User) Delete(ctx context.Context, db DB) error

Delete deletes the User from the database.

func (*User) FKUserAPIKey_APIKeyID

func (u *User) FKUserAPIKey_APIKeyID(ctx context.Context, db DB) (*UserAPIKey, error)

FKUserAPIKey_APIKeyID returns the UserAPIKey associated with the User's (APIKeyID).

Generated from foreign key 'users_api_key_id_fkey'.

func (*User) Insert

func (u *User) Insert(ctx context.Context, db DB) (*User, error)

Insert inserts the User to the database.

func (*User) Restore

func (u *User) Restore(ctx context.Context, db DB) (*User, error)

Restore restores a soft deleted User from the database.

func (*User) SetUpdateParams

func (u *User) SetUpdateParams(params *UserUpdateParams)

SetUpdateParams updates public.users struct fields with the specified params.

func (*User) SoftDelete

func (u *User) SoftDelete(ctx context.Context, db DB) error

SoftDelete soft deletes the User from the database via 'deleted_at'.

func (*User) Update

func (u *User) Update(ctx context.Context, db DB) (*User, error)

Update updates a User in the database.

func (*User) Upsert

func (u *User) Upsert(ctx context.Context, db DB, params *UserCreateParams) (*User, error)

Upsert upserts a User in the database. Requires appropriate PK(s) to be set beforehand.

type UserAPIKey

type UserAPIKey struct {
	UserAPIKeyID UserAPIKeyID `json:"-" db:"user_api_key_id" nullable:"false"`                    // user_api_key_id
	APIKey       string       `json:"apiKey" db:"api_key" required:"true" nullable:"false"`       // api_key
	ExpiresOn    time.Time    `json:"expiresOn" db:"expires_on" required:"true" nullable:"false"` // expires_on
	UserID       UserID       `json:"userID" db:"user_id" required:"true" nullable:"false"`       // user_id

	UserJoin *User `json:"-" db:"user_user_id" openapi-go:"ignore"` // O2O users (inferred)

}

UserAPIKey represents a row from 'public.user_api_keys'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateUserAPIKey

func CreateUserAPIKey(ctx context.Context, db DB, params *UserAPIKeyCreateParams) (*UserAPIKey, error)

CreateUserAPIKey creates a new UserAPIKey in the database with the given params.

func UserAPIKeyByAPIKey

func UserAPIKeyByAPIKey(ctx context.Context, db DB, apiKey string, opts ...UserAPIKeySelectConfigOption) (*UserAPIKey, error)

UserAPIKeyByAPIKey retrieves a row from 'public.user_api_keys' as a UserAPIKey.

Generated from index 'user_api_keys_api_key_key'.

func UserAPIKeyByUserAPIKeyID

func UserAPIKeyByUserAPIKeyID(ctx context.Context, db DB, userAPIKeyID UserAPIKeyID, opts ...UserAPIKeySelectConfigOption) (*UserAPIKey, error)

UserAPIKeyByUserAPIKeyID retrieves a row from 'public.user_api_keys' as a UserAPIKey.

Generated from index 'user_api_keys_pkey'.

func UserAPIKeyByUserID

func UserAPIKeyByUserID(ctx context.Context, db DB, userID UserID, opts ...UserAPIKeySelectConfigOption) (*UserAPIKey, error)

UserAPIKeyByUserID retrieves a row from 'public.user_api_keys' as a UserAPIKey.

Generated from index 'user_api_keys_user_id_key'.

func UserAPIKeyPaginatedByUserAPIKeyIDAsc

func UserAPIKeyPaginatedByUserAPIKeyIDAsc(ctx context.Context, db DB, userAPIKeyID UserAPIKeyID, opts ...UserAPIKeySelectConfigOption) ([]UserAPIKey, error)

UserAPIKeyPaginatedByUserAPIKeyIDAsc returns a cursor-paginated list of UserAPIKey in Asc order.

func UserAPIKeyPaginatedByUserAPIKeyIDDesc

func UserAPIKeyPaginatedByUserAPIKeyIDDesc(ctx context.Context, db DB, userAPIKeyID UserAPIKeyID, opts ...UserAPIKeySelectConfigOption) ([]UserAPIKey, error)

UserAPIKeyPaginatedByUserAPIKeyIDDesc returns a cursor-paginated list of UserAPIKey in Desc order.

func (*UserAPIKey) Delete

func (uak *UserAPIKey) Delete(ctx context.Context, db DB) error

Delete deletes the UserAPIKey from the database.

func (*UserAPIKey) FKUser_UserID

func (uak *UserAPIKey) FKUser_UserID(ctx context.Context, db DB) (*User, error)

FKUser_UserID returns the User associated with the UserAPIKey's (UserID).

Generated from foreign key 'user_api_keys_user_id_fkey'.

func (*UserAPIKey) Insert

func (uak *UserAPIKey) Insert(ctx context.Context, db DB) (*UserAPIKey, error)

Insert inserts the UserAPIKey to the database.

func (*UserAPIKey) SetUpdateParams

func (uak *UserAPIKey) SetUpdateParams(params *UserAPIKeyUpdateParams)

SetUpdateParams updates public.user_api_keys struct fields with the specified params.

func (*UserAPIKey) Update

func (uak *UserAPIKey) Update(ctx context.Context, db DB) (*UserAPIKey, error)

Update updates a UserAPIKey in the database.

func (*UserAPIKey) Upsert

func (uak *UserAPIKey) Upsert(ctx context.Context, db DB, params *UserAPIKeyCreateParams) (*UserAPIKey, error)

Upsert upserts a UserAPIKey in the database. Requires appropriate PK(s) to be set beforehand.

type UserAPIKeyCreateParams

type UserAPIKeyCreateParams struct {
	APIKey    string    `json:"apiKey" required:"true" nullable:"false"`    // api_key
	ExpiresOn time.Time `json:"expiresOn" required:"true" nullable:"false"` // expires_on
	UserID    UserID    `json:"userID" required:"true" nullable:"false"`    // user_id
}

UserAPIKeyCreateParams represents insert params for 'public.user_api_keys'.

type UserAPIKeyID

type UserAPIKeyID int

type UserAPIKeyJoins

type UserAPIKeyJoins struct {
	User bool // O2O users
}

type UserAPIKeyOrderBy

type UserAPIKeyOrderBy string
const (
	UserAPIKeyExpiresOnDescNullsFirst UserAPIKeyOrderBy = " expires_on DESC NULLS FIRST "
	UserAPIKeyExpiresOnDescNullsLast  UserAPIKeyOrderBy = " expires_on DESC NULLS LAST "
	UserAPIKeyExpiresOnAscNullsFirst  UserAPIKeyOrderBy = " expires_on ASC NULLS FIRST "
	UserAPIKeyExpiresOnAscNullsLast   UserAPIKeyOrderBy = " expires_on ASC NULLS LAST "
)

type UserAPIKeySelectConfig

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

type UserAPIKeySelectConfigOption

type UserAPIKeySelectConfigOption func(*UserAPIKeySelectConfig)

func WithUserAPIKeyFilters

func WithUserAPIKeyFilters(filters map[string][]any) UserAPIKeySelectConfigOption

WithUserAPIKeyFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithUserAPIKeyJoin

func WithUserAPIKeyJoin(joins UserAPIKeyJoins) UserAPIKeySelectConfigOption

WithUserAPIKeyJoin joins with the given tables.

func WithUserAPIKeyLimit

func WithUserAPIKeyLimit(limit int) UserAPIKeySelectConfigOption

WithUserAPIKeyLimit limits row selection.

func WithUserAPIKeyOrderBy

func WithUserAPIKeyOrderBy(rows ...UserAPIKeyOrderBy) UserAPIKeySelectConfigOption

WithUserAPIKeyOrderBy orders results by the given columns.

type UserAPIKeyUpdateParams

type UserAPIKeyUpdateParams struct {
	APIKey    *string    `json:"apiKey" nullable:"false"`    // api_key
	ExpiresOn *time.Time `json:"expiresOn" nullable:"false"` // expires_on
	UserID    *UserID    `json:"userID" nullable:"false"`    // user_id
}

UserAPIKeyUpdateParams represents update params for 'public.user_api_keys'.

type UserCreateParams

type UserCreateParams struct {
	APIKeyID                 *UserAPIKeyID `json:"-"`                                                                         // api_key_id
	Email                    string        `json:"email" required:"true" nullable:"false"`                                    // email
	ExternalID               string        `json:"-" nullable:"false"`                                                        // external_id
	FirstName                *string       `json:"firstName"`                                                                 // first_name
	HasGlobalNotifications   bool          `json:"hasGlobalNotifications" required:"true" nullable:"false"`                   // has_global_notifications
	HasPersonalNotifications bool          `json:"hasPersonalNotifications" required:"true" nullable:"false"`                 // has_personal_notifications
	LastName                 *string       `json:"lastName"`                                                                  // last_name
	RoleRank                 int           `json:"-" nullable:"false"`                                                        // role_rank
	Scopes                   models.Scopes `json:"scopes" required:"true" nullable:"false" ref:"#/components/schemas/Scopes"` // scopes
	Username                 string        `json:"username" required:"true" nullable:"false"`                                 // username
}

UserCreateParams represents insert params for 'public.users'.

type UserID

type UserID struct {
	uuid.UUID
}

func NewUserID

func NewUserID(id uuid.UUID) UserID

type UserJoins

type UserJoins struct {
	NotificationsReceiver bool // M2O notifications
	NotificationsSender   bool // M2O notifications
	TimeEntries           bool // M2O time_entries
	UserNotifications     bool // M2O user_notifications
	TeamsMember           bool // M2M user_team
	UserAPIKey            bool // O2O user_api_keys
	WorkItemsAssignedUser bool // M2M work_item_assigned_user
	WorkItemComments      bool // M2O work_item_comments
}

type UserNotification

type UserNotification struct {
	UserNotificationID UserNotificationID `json:"userNotificationID" db:"user_notification_id" required:"true" nullable:"false"` // user_notification_id
	NotificationID     NotificationID     `json:"notificationID" db:"notification_id" required:"true" nullable:"false"`          // notification_id
	Read               bool               `json:"read" db:"read" required:"true" nullable:"false"`                               // read
	UserID             UserID             `json:"userID" db:"user_id" required:"true" nullable:"false"`                          // user_id

	NotificationJoin *Notification `json:"-" db:"notification_notification_id" openapi-go:"ignore"` // O2O notifications (generated from M2O)
	UserJoin         *User         `json:"-" db:"user_user_id" openapi-go:"ignore"`                 // O2O users (generated from M2O)

}

UserNotification represents a row from 'public.user_notifications'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateUserNotification

func CreateUserNotification(ctx context.Context, db DB, params *UserNotificationCreateParams) (*UserNotification, error)

CreateUserNotification creates a new UserNotification in the database with the given params.

func UserNotificationByNotificationIDUserID

func UserNotificationByNotificationIDUserID(ctx context.Context, db DB, notificationID NotificationID, userID UserID, opts ...UserNotificationSelectConfigOption) (*UserNotification, error)

UserNotificationByNotificationIDUserID retrieves a row from 'public.user_notifications' as a UserNotification.

Generated from index 'user_notifications_notification_id_user_id_key'.

func UserNotificationByUserNotificationID

func UserNotificationByUserNotificationID(ctx context.Context, db DB, userNotificationID UserNotificationID, opts ...UserNotificationSelectConfigOption) (*UserNotification, error)

UserNotificationByUserNotificationID retrieves a row from 'public.user_notifications' as a UserNotification.

Generated from index 'user_notifications_pkey'.

func UserNotificationPaginatedByNotificationIDAsc

func UserNotificationPaginatedByNotificationIDAsc(ctx context.Context, db DB, notificationID NotificationID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationPaginatedByNotificationIDAsc returns a cursor-paginated list of UserNotification in Asc order.

func UserNotificationPaginatedByNotificationIDDesc

func UserNotificationPaginatedByNotificationIDDesc(ctx context.Context, db DB, notificationID NotificationID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationPaginatedByNotificationIDDesc returns a cursor-paginated list of UserNotification in Desc order.

func UserNotificationPaginatedByUserNotificationIDAsc

func UserNotificationPaginatedByUserNotificationIDAsc(ctx context.Context, db DB, userNotificationID UserNotificationID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationPaginatedByUserNotificationIDAsc returns a cursor-paginated list of UserNotification in Asc order.

func UserNotificationPaginatedByUserNotificationIDDesc

func UserNotificationPaginatedByUserNotificationIDDesc(ctx context.Context, db DB, userNotificationID UserNotificationID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationPaginatedByUserNotificationIDDesc returns a cursor-paginated list of UserNotification in Desc order.

func UserNotificationsByNotificationID

func UserNotificationsByNotificationID(ctx context.Context, db DB, notificationID NotificationID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationsByNotificationID retrieves a row from 'public.user_notifications' as a UserNotification.

Generated from index 'user_notifications_notification_id_user_id_key'.

func UserNotificationsByUserID

func UserNotificationsByUserID(ctx context.Context, db DB, userID UserID, opts ...UserNotificationSelectConfigOption) ([]UserNotification, error)

UserNotificationsByUserID retrieves a row from 'public.user_notifications' as a UserNotification.

Generated from index 'user_notifications_user_id_idx'.

func (*UserNotification) Delete

func (un *UserNotification) Delete(ctx context.Context, db DB) error

Delete deletes the UserNotification from the database.

func (*UserNotification) FKNotification_NotificationID

func (un *UserNotification) FKNotification_NotificationID(ctx context.Context, db DB) (*Notification, error)

FKNotification_NotificationID returns the Notification associated with the UserNotification's (NotificationID).

Generated from foreign key 'user_notifications_notification_id_fkey'.

func (*UserNotification) FKUser_UserID

func (un *UserNotification) FKUser_UserID(ctx context.Context, db DB) (*User, error)

FKUser_UserID returns the User associated with the UserNotification's (UserID).

Generated from foreign key 'user_notifications_user_id_fkey'.

func (*UserNotification) Insert

func (un *UserNotification) Insert(ctx context.Context, db DB) (*UserNotification, error)

Insert inserts the UserNotification to the database.

func (*UserNotification) SetUpdateParams

func (un *UserNotification) SetUpdateParams(params *UserNotificationUpdateParams)

SetUpdateParams updates public.user_notifications struct fields with the specified params.

func (*UserNotification) Update

func (un *UserNotification) Update(ctx context.Context, db DB) (*UserNotification, error)

Update updates a UserNotification in the database.

func (*UserNotification) Upsert

Upsert upserts a UserNotification in the database. Requires appropriate PK(s) to be set beforehand.

type UserNotificationCreateParams

type UserNotificationCreateParams struct {
	NotificationID NotificationID `json:"notificationID" required:"true" nullable:"false"` // notification_id
	Read           bool           `json:"read" required:"true" nullable:"false"`           // read
	UserID         UserID         `json:"userID" required:"true" nullable:"false"`         // user_id
}

UserNotificationCreateParams represents insert params for 'public.user_notifications'.

type UserNotificationID

type UserNotificationID int

type UserNotificationJoins

type UserNotificationJoins struct {
	Notification bool // O2O notifications
	User         bool // O2O users
}

type UserNotificationOrderBy

type UserNotificationOrderBy string

type UserNotificationSelectConfig

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

type UserNotificationSelectConfigOption

type UserNotificationSelectConfigOption func(*UserNotificationSelectConfig)

func WithUserNotificationFilters

func WithUserNotificationFilters(filters map[string][]any) UserNotificationSelectConfigOption

WithUserNotificationFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithUserNotificationJoin

func WithUserNotificationJoin(joins UserNotificationJoins) UserNotificationSelectConfigOption

WithUserNotificationJoin joins with the given tables.

func WithUserNotificationLimit

func WithUserNotificationLimit(limit int) UserNotificationSelectConfigOption

WithUserNotificationLimit limits row selection.

type UserNotificationUpdateParams

type UserNotificationUpdateParams struct {
	NotificationID *NotificationID `json:"notificationID" nullable:"false"` // notification_id
	Read           *bool           `json:"read" nullable:"false"`           // read
	UserID         *UserID         `json:"userID" nullable:"false"`         // user_id
}

UserNotificationUpdateParams represents update params for 'public.user_notifications'.

type UserOrderBy

type UserOrderBy string
const (
	UserCreatedAtDescNullsFirst UserOrderBy = " created_at DESC NULLS FIRST "
	UserCreatedAtDescNullsLast  UserOrderBy = " created_at DESC NULLS LAST "
	UserCreatedAtAscNullsFirst  UserOrderBy = " created_at ASC NULLS FIRST "
	UserCreatedAtAscNullsLast   UserOrderBy = " created_at ASC NULLS LAST "
	UserDeletedAtDescNullsFirst UserOrderBy = " deleted_at DESC NULLS FIRST "
	UserDeletedAtDescNullsLast  UserOrderBy = " deleted_at DESC NULLS LAST "
	UserDeletedAtAscNullsFirst  UserOrderBy = " deleted_at ASC NULLS FIRST "
	UserDeletedAtAscNullsLast   UserOrderBy = " deleted_at ASC NULLS LAST "
	UserUpdatedAtDescNullsFirst UserOrderBy = " updated_at DESC NULLS FIRST "
	UserUpdatedAtDescNullsLast  UserOrderBy = " updated_at DESC NULLS LAST "
	UserUpdatedAtAscNullsFirst  UserOrderBy = " updated_at ASC NULLS FIRST "
	UserUpdatedAtAscNullsLast   UserOrderBy = " updated_at ASC NULLS LAST "
)

type UserSelectConfig

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

type UserSelectConfigOption

type UserSelectConfigOption func(*UserSelectConfig)

func WithDeletedUserOnly

func WithDeletedUserOnly() UserSelectConfigOption

WithDeletedUserOnly limits result to records marked as deleted.

func WithUserFilters

func WithUserFilters(filters map[string][]any) UserSelectConfigOption

WithUserFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithUserJoin

func WithUserJoin(joins UserJoins) UserSelectConfigOption

WithUserJoin joins with the given tables.

func WithUserLimit

func WithUserLimit(limit int) UserSelectConfigOption

WithUserLimit limits row selection.

func WithUserOrderBy

func WithUserOrderBy(rows ...UserOrderBy) UserSelectConfigOption

WithUserOrderBy orders results by the given columns.

type UserTeam

type UserTeam struct {
	TeamID TeamID `json:"teamID" db:"team_id" required:"true" nullable:"false"` // team_id
	Member UserID `json:"member" db:"member" required:"true" nullable:"false"`  // member

	MemberTeamsJoin *[]Team `json:"-" db:"user_team_teams" openapi-go:"ignore"`   // M2M user_team
	TeamMembersJoin *[]User `json:"-" db:"user_team_members" openapi-go:"ignore"` // M2M user_team

}

UserTeam represents a row from 'public.user_team'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateUserTeam

func CreateUserTeam(ctx context.Context, db DB, params *UserTeamCreateParams) (*UserTeam, error)

CreateUserTeam creates a new UserTeam in the database with the given params.

func UserTeamByMemberTeamID

func UserTeamByMemberTeamID(ctx context.Context, db DB, member UserID, teamID TeamID, opts ...UserTeamSelectConfigOption) (*UserTeam, error)

UserTeamByMemberTeamID retrieves a row from 'public.user_team' as a UserTeam.

Generated from index 'user_team_pkey'.

func UserTeamsByMember

func UserTeamsByMember(ctx context.Context, db DB, member UserID, opts ...UserTeamSelectConfigOption) ([]UserTeam, error)

UserTeamsByMember retrieves a row from 'public.user_team' as a UserTeam.

Generated from index 'user_team_member_idx'.

func UserTeamsByTeamID

func UserTeamsByTeamID(ctx context.Context, db DB, teamID TeamID, opts ...UserTeamSelectConfigOption) ([]UserTeam, error)

UserTeamsByTeamID retrieves a row from 'public.user_team' as a UserTeam.

Generated from index 'user_team_pkey'.

func UserTeamsByTeamIDMember

func UserTeamsByTeamIDMember(ctx context.Context, db DB, teamID TeamID, member UserID, opts ...UserTeamSelectConfigOption) ([]UserTeam, error)

UserTeamsByTeamIDMember retrieves a row from 'public.user_team' as a UserTeam.

Generated from index 'user_team_team_id_member_idx'.

func (*UserTeam) Delete

func (ut *UserTeam) Delete(ctx context.Context, db DB) error

Delete deletes the UserTeam from the database.

func (*UserTeam) FKTeam_TeamID

func (ut *UserTeam) FKTeam_TeamID(ctx context.Context, db DB) (*Team, error)

FKTeam_TeamID returns the Team associated with the UserTeam's (TeamID).

Generated from foreign key 'user_team_team_id_fkey'.

func (*UserTeam) FKUser_Member

func (ut *UserTeam) FKUser_Member(ctx context.Context, db DB) (*User, error)

FKUser_Member returns the User associated with the UserTeam's (Member).

Generated from foreign key 'user_team_member_fkey'.

func (*UserTeam) Insert

func (ut *UserTeam) Insert(ctx context.Context, db DB) (*UserTeam, error)

Insert inserts the UserTeam to the database.

func (*UserTeam) SetUpdateParams

func (ut *UserTeam) SetUpdateParams(params *UserTeamUpdateParams)

SetUpdateParams updates public.user_team struct fields with the specified params.

type UserTeamCreateParams

type UserTeamCreateParams struct {
	Member UserID `json:"member" required:"true" nullable:"false"` // member
	TeamID TeamID `json:"teamID" required:"true" nullable:"false"` // team_id
}

UserTeamCreateParams represents insert params for 'public.user_team'.

type UserTeamJoins

type UserTeamJoins struct {
	TeamsMember bool // M2M user_team
	Members     bool // M2M user_team
}

type UserTeamOrderBy

type UserTeamOrderBy string

type UserTeamSelectConfig

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

type UserTeamSelectConfigOption

type UserTeamSelectConfigOption func(*UserTeamSelectConfig)

func WithUserTeamFilters

func WithUserTeamFilters(filters map[string][]any) UserTeamSelectConfigOption

WithUserTeamFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithUserTeamJoin

func WithUserTeamJoin(joins UserTeamJoins) UserTeamSelectConfigOption

WithUserTeamJoin joins with the given tables.

func WithUserTeamLimit

func WithUserTeamLimit(limit int) UserTeamSelectConfigOption

WithUserTeamLimit limits row selection.

type UserTeamUpdateParams

type UserTeamUpdateParams struct {
	Member *UserID `json:"member" nullable:"false"` // member
	TeamID *TeamID `json:"teamID" nullable:"false"` // team_id
}

UserTeamUpdateParams represents update params for 'public.user_team'.

type UserUpdateParams

type UserUpdateParams struct {
	APIKeyID                 **UserAPIKeyID `json:"-"`                                                         // api_key_id
	Email                    *string        `json:"email" nullable:"false"`                                    // email
	ExternalID               *string        `json:"-" nullable:"false"`                                        // external_id
	FirstName                **string       `json:"firstName"`                                                 // first_name
	HasGlobalNotifications   *bool          `json:"hasGlobalNotifications" nullable:"false"`                   // has_global_notifications
	HasPersonalNotifications *bool          `json:"hasPersonalNotifications" nullable:"false"`                 // has_personal_notifications
	LastName                 **string       `json:"lastName"`                                                  // last_name
	RoleRank                 *int           `json:"-" nullable:"false"`                                        // role_rank
	Scopes                   *models.Scopes `json:"scopes" nullable:"false" ref:"#/components/schemas/Scopes"` // scopes
	Username                 *string        `json:"username" nullable:"false"`                                 // username
}

UserUpdateParams represents update params for 'public.users'.

type User__WIAU_WorkItem

type User__WIAU_WorkItem struct {
	User User                `json:"user" db:"users" required:"true"`
	Role models.WorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

User__WIAU_WorkItem represents a M2M join against "public.work_item_assigned_user"

type User__WIAU_WorkItemAssignedUser

type User__WIAU_WorkItemAssignedUser struct {
	User User                `json:"user" db:"users" required:"true"`
	Role models.WorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

User__WIAU_WorkItemAssignedUser represents a M2M join against "public.work_item_assigned_user"

type WorkItem

type WorkItem struct {
	WorkItemID     WorkItemID     `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`          // work_item_id
	Title          string         `json:"title" db:"title" required:"true" nullable:"false"`                      // title
	Description    string         `json:"description" db:"description" required:"true" nullable:"false"`          // description
	WorkItemTypeID WorkItemTypeID `json:"workItemTypeID" db:"work_item_type_id" required:"true" nullable:"false"` // work_item_type_id
	Metadata       map[string]any `json:"metadata" db:"metadata" required:"true" nullable:"false"`                // metadata
	TeamID         TeamID         `json:"teamID" db:"team_id" required:"true" nullable:"false"`                   // team_id
	KanbanStepID   KanbanStepID   `json:"kanbanStepID" db:"kanban_step_id" required:"true" nullable:"false"`      // kanban_step_id
	ClosedAt       *time.Time     `json:"closedAt" db:"closed_at"`                                                // closed_at
	TargetDate     time.Time      `json:"targetDate" db:"target_date" required:"true" nullable:"false"`           // target_date
	CreatedAt      time.Time      `json:"createdAt" db:"created_at" required:"true" nullable:"false"`             // created_at
	UpdatedAt      time.Time      `json:"updatedAt" db:"updated_at" required:"true" nullable:"false"`             // updated_at
	DeletedAt      *time.Time     `json:"deletedAt" db:"deleted_at"`                                              // deleted_at

	DemoTwoWorkItemJoin          *DemoTwoWorkItem       `json:"-" db:"demo_two_work_item_work_item_id" openapi-go:"ignore"`        // O2O demo_two_work_items (inferred)
	DemoWorkItemJoin             *DemoWorkItem          `json:"-" db:"demo_work_item_work_item_id" openapi-go:"ignore"`            // O2O demo_work_items (inferred)
	WorkItemTimeEntriesJoin      *[]TimeEntry           `json:"-" db:"time_entries" openapi-go:"ignore"`                           // M2O work_items
	WorkItemAssignedUsersJoin    *[]User__WIAU_WorkItem `json:"-" db:"work_item_assigned_user_assigned_users" openapi-go:"ignore"` // M2M work_item_assigned_user
	WorkItemWorkItemCommentsJoin *[]WorkItemComment     `json:"-" db:"work_item_comments" openapi-go:"ignore"`                     // M2O work_items
	WorkItemWorkItemTagsJoin     *[]WorkItemTag         `json:"-" db:"work_item_work_item_tag_work_item_tags" openapi-go:"ignore"` // M2M work_item_work_item_tag
	KanbanStepJoin               *KanbanStep            `json:"-" db:"kanban_step_kanban_step_id" openapi-go:"ignore"`             // O2O kanban_steps (inferred)
	TeamJoin                     *Team                  `json:"-" db:"team_team_id" openapi-go:"ignore"`                           // O2O teams (inferred)
	WorkItemTypeJoin             *WorkItemType          `json:"-" db:"work_item_type_work_item_type_id" openapi-go:"ignore"`       // O2O work_item_types (inferred)

}

WorkItem represents a row from 'public.work_items'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItem

func CreateWorkItem(ctx context.Context, db DB, params *WorkItemCreateParams) (*WorkItem, error)

CreateWorkItem creates a new WorkItem in the database with the given params.

func WorkItemByWorkItemID

func WorkItemByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemSelectConfigOption) (*WorkItem, error)

WorkItemByWorkItemID retrieves a row from 'public.work_items' as a WorkItem.

Generated from index 'work_items_pkey'.

func WorkItemPaginatedByWorkItemIDAsc

func WorkItemPaginatedByWorkItemIDAsc(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItemPaginatedByWorkItemIDAsc returns a cursor-paginated list of WorkItem in Asc order.

func WorkItemPaginatedByWorkItemIDDesc

func WorkItemPaginatedByWorkItemIDDesc(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItemPaginatedByWorkItemIDDesc returns a cursor-paginated list of WorkItem in Desc order.

func WorkItems

func WorkItems(ctx context.Context, db DB, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItems retrieves a row from 'public.work_items' as a WorkItem.

Generated from index '[xo] base filter query'.

func WorkItemsByDeletedAt_WhereDeletedAtIsNotNull

func WorkItemsByDeletedAt_WhereDeletedAtIsNotNull(ctx context.Context, db DB, deletedAt *time.Time, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItemsByDeletedAt_WhereDeletedAtIsNotNull retrieves a row from 'public.work_items' as a WorkItem.

Generated from index 'work_items_deleted_at_idx'.

func WorkItemsByTeamID

func WorkItemsByTeamID(ctx context.Context, db DB, teamID TeamID, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItemsByTeamID retrieves a row from 'public.work_items' as a WorkItem.

Generated from index 'work_items_team_id_idx'.

func WorkItemsByTitle

func WorkItemsByTitle(ctx context.Context, db DB, title string, opts ...WorkItemSelectConfigOption) ([]WorkItem, error)

WorkItemsByTitle retrieves a row from 'public.work_items' as a WorkItem.

Generated from index 'work_items_title_description_idx1'.

func (*WorkItem) Delete

func (wi *WorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItem from the database.

func (*WorkItem) FKKanbanStep_KanbanStepID

func (wi *WorkItem) FKKanbanStep_KanbanStepID(ctx context.Context, db DB) (*KanbanStep, error)

FKKanbanStep_KanbanStepID returns the KanbanStep associated with the WorkItem's (KanbanStepID).

Generated from foreign key 'work_items_kanban_step_id_fkey'.

func (*WorkItem) FKTeam_TeamID

func (wi *WorkItem) FKTeam_TeamID(ctx context.Context, db DB) (*Team, error)

FKTeam_TeamID returns the Team associated with the WorkItem's (TeamID).

Generated from foreign key 'work_items_team_id_fkey'.

func (*WorkItem) FKWorkItemType_WorkItemTypeID

func (wi *WorkItem) FKWorkItemType_WorkItemTypeID(ctx context.Context, db DB) (*WorkItemType, error)

FKWorkItemType_WorkItemTypeID returns the WorkItemType associated with the WorkItem's (WorkItemTypeID).

Generated from foreign key 'work_items_work_item_type_id_fkey'.

func (*WorkItem) Insert

func (wi *WorkItem) Insert(ctx context.Context, db DB) (*WorkItem, error)

Insert inserts the WorkItem to the database.

func (*WorkItem) Restore

func (wi *WorkItem) Restore(ctx context.Context, db DB) (*WorkItem, error)

Restore restores a soft deleted WorkItem from the database.

func (*WorkItem) SetUpdateParams

func (wi *WorkItem) SetUpdateParams(params *WorkItemUpdateParams)

SetUpdateParams updates public.work_items struct fields with the specified params.

func (*WorkItem) SoftDelete

func (wi *WorkItem) SoftDelete(ctx context.Context, db DB) error

SoftDelete soft deletes the WorkItem from the database via 'deleted_at'.

func (*WorkItem) Update

func (wi *WorkItem) Update(ctx context.Context, db DB) (*WorkItem, error)

Update updates a WorkItem in the database.

func (*WorkItem) Upsert

func (wi *WorkItem) Upsert(ctx context.Context, db DB, params *WorkItemCreateParams) (*WorkItem, error)

Upsert upserts a WorkItem in the database. Requires appropriate PK(s) to be set beforehand.

type WorkItemAssignedUser

type WorkItemAssignedUser struct {
	WorkItemID   WorkItemID          `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`                           // work_item_id
	AssignedUser UserID              `json:"assignedUser" db:"assigned_user" required:"true" nullable:"false"`                        // assigned_user
	Role         models.WorkItemRole `json:"role" db:"role" required:"true" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role

	AssignedUserWorkItemsJoin *[]WorkItem__WIAU_WorkItemAssignedUser `json:"-" db:"work_item_assigned_user_work_items" openapi-go:"ignore"`     // M2M work_item_assigned_user
	WorkItemAssignedUsersJoin *[]User__WIAU_WorkItemAssignedUser     `json:"-" db:"work_item_assigned_user_assigned_users" openapi-go:"ignore"` // M2M work_item_assigned_user

}

WorkItemAssignedUser represents a row from 'public.work_item_assigned_user'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItemAssignedUser

func CreateWorkItemAssignedUser(ctx context.Context, db DB, params *WorkItemAssignedUserCreateParams) (*WorkItemAssignedUser, error)

CreateWorkItemAssignedUser creates a new WorkItemAssignedUser in the database with the given params.

func WorkItemAssignedUserByWorkItemIDAssignedUser

func WorkItemAssignedUserByWorkItemIDAssignedUser(ctx context.Context, db DB, workItemID WorkItemID, assignedUser UserID, opts ...WorkItemAssignedUserSelectConfigOption) (*WorkItemAssignedUser, error)

WorkItemAssignedUserByWorkItemIDAssignedUser retrieves a row from 'public.work_item_assigned_user' as a WorkItemAssignedUser.

Generated from index 'work_item_assigned_user_pkey'.

func WorkItemAssignedUsersByAssignedUser

func WorkItemAssignedUsersByAssignedUser(ctx context.Context, db DB, assignedUser UserID, opts ...WorkItemAssignedUserSelectConfigOption) ([]WorkItemAssignedUser, error)

WorkItemAssignedUsersByAssignedUser retrieves a row from 'public.work_item_assigned_user' as a WorkItemAssignedUser.

Generated from index 'work_item_assigned_user_pkey'.

func WorkItemAssignedUsersByAssignedUserWorkItemID

func WorkItemAssignedUsersByAssignedUserWorkItemID(ctx context.Context, db DB, assignedUser UserID, workItemID WorkItemID, opts ...WorkItemAssignedUserSelectConfigOption) ([]WorkItemAssignedUser, error)

WorkItemAssignedUsersByAssignedUserWorkItemID retrieves a row from 'public.work_item_assigned_user' as a WorkItemAssignedUser.

Generated from index 'work_item_assigned_user_assigned_user_work_item_id_idx'.

func WorkItemAssignedUsersByWorkItemID

func WorkItemAssignedUsersByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemAssignedUserSelectConfigOption) ([]WorkItemAssignedUser, error)

WorkItemAssignedUsersByWorkItemID retrieves a row from 'public.work_item_assigned_user' as a WorkItemAssignedUser.

Generated from index 'work_item_assigned_user_pkey'.

func (*WorkItemAssignedUser) Delete

func (wiau *WorkItemAssignedUser) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItemAssignedUser from the database.

func (*WorkItemAssignedUser) FKUser_AssignedUser

func (wiau *WorkItemAssignedUser) FKUser_AssignedUser(ctx context.Context, db DB) (*User, error)

FKUser_AssignedUser returns the User associated with the WorkItemAssignedUser's (AssignedUser).

Generated from foreign key 'work_item_assigned_user_assigned_user_fkey'.

func (*WorkItemAssignedUser) FKWorkItem_WorkItemID

func (wiau *WorkItemAssignedUser) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the WorkItemAssignedUser's (WorkItemID).

Generated from foreign key 'work_item_assigned_user_work_item_id_fkey'.

func (*WorkItemAssignedUser) Insert

Insert inserts the WorkItemAssignedUser to the database.

func (*WorkItemAssignedUser) SetUpdateParams

func (wiau *WorkItemAssignedUser) SetUpdateParams(params *WorkItemAssignedUserUpdateParams)

SetUpdateParams updates public.work_item_assigned_user struct fields with the specified params.

func (*WorkItemAssignedUser) Update

Update updates a WorkItemAssignedUser in the database.

func (*WorkItemAssignedUser) Upsert

Upsert upserts a WorkItemAssignedUser in the database. Requires appropriate PK(s) to be set beforehand.

type WorkItemAssignedUserCreateParams

type WorkItemAssignedUserCreateParams struct {
	AssignedUser UserID              `json:"assignedUser" required:"true" nullable:"false"`                                 // assigned_user
	Role         models.WorkItemRole `json:"role" required:"true" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role
	WorkItemID   WorkItemID          `json:"workItemID" required:"true" nullable:"false"`                                   // work_item_id
}

WorkItemAssignedUserCreateParams represents insert params for 'public.work_item_assigned_user'.

type WorkItemAssignedUserJoins

type WorkItemAssignedUserJoins struct {
	WorkItemsAssignedUser bool // M2M work_item_assigned_user
	AssignedUsers         bool // M2M work_item_assigned_user
}

type WorkItemAssignedUserOrderBy

type WorkItemAssignedUserOrderBy string

type WorkItemAssignedUserSelectConfig

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

type WorkItemAssignedUserSelectConfigOption

type WorkItemAssignedUserSelectConfigOption func(*WorkItemAssignedUserSelectConfig)

func WithWorkItemAssignedUserFilters

func WithWorkItemAssignedUserFilters(filters map[string][]any) WorkItemAssignedUserSelectConfigOption

WithWorkItemAssignedUserFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemAssignedUserJoin

func WithWorkItemAssignedUserJoin(joins WorkItemAssignedUserJoins) WorkItemAssignedUserSelectConfigOption

WithWorkItemAssignedUserJoin joins with the given tables.

func WithWorkItemAssignedUserLimit

func WithWorkItemAssignedUserLimit(limit int) WorkItemAssignedUserSelectConfigOption

WithWorkItemAssignedUserLimit limits row selection.

type WorkItemAssignedUserUpdateParams

type WorkItemAssignedUserUpdateParams struct {
	AssignedUser *UserID              `json:"assignedUser" nullable:"false"`                                 // assigned_user
	Role         *models.WorkItemRole `json:"role" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role
	WorkItemID   *WorkItemID          `json:"workItemID" nullable:"false"`                                   // work_item_id
}

WorkItemAssignedUserUpdateParams represents update params for 'public.work_item_assigned_user'.

type WorkItemComment

type WorkItemComment struct {
	WorkItemCommentID WorkItemCommentID `json:"workItemCommentID" db:"work_item_comment_id" required:"true" nullable:"false"` // work_item_comment_id
	WorkItemID        WorkItemID        `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`                // work_item_id
	UserID            UserID            `json:"userID" db:"user_id" required:"true" nullable:"false"`                         // user_id
	Message           string            `json:"message" db:"message" required:"true" nullable:"false"`                        // message
	CreatedAt         time.Time         `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                   // created_at
	UpdatedAt         time.Time         `json:"updatedAt" db:"updated_at" required:"true" nullable:"false"`                   // updated_at

	UserJoin     *User     `json:"-" db:"user_user_id" openapi-go:"ignore"`           // O2O users (generated from M2O)
	WorkItemJoin *WorkItem `json:"-" db:"work_item_work_item_id" openapi-go:"ignore"` // O2O work_items (generated from M2O)

}

WorkItemComment represents a row from 'public.work_item_comments'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItemComment

func CreateWorkItemComment(ctx context.Context, db DB, params *WorkItemCommentCreateParams) (*WorkItemComment, error)

CreateWorkItemComment creates a new WorkItemComment in the database with the given params.

func WorkItemCommentByWorkItemCommentID

func WorkItemCommentByWorkItemCommentID(ctx context.Context, db DB, workItemCommentID WorkItemCommentID, opts ...WorkItemCommentSelectConfigOption) (*WorkItemComment, error)

WorkItemCommentByWorkItemCommentID retrieves a row from 'public.work_item_comments' as a WorkItemComment.

Generated from index 'work_item_comments_pkey'.

func WorkItemCommentPaginatedByWorkItemCommentIDAsc

func WorkItemCommentPaginatedByWorkItemCommentIDAsc(ctx context.Context, db DB, workItemCommentID WorkItemCommentID, opts ...WorkItemCommentSelectConfigOption) ([]WorkItemComment, error)

WorkItemCommentPaginatedByWorkItemCommentIDAsc returns a cursor-paginated list of WorkItemComment in Asc order.

func WorkItemCommentPaginatedByWorkItemCommentIDDesc

func WorkItemCommentPaginatedByWorkItemCommentIDDesc(ctx context.Context, db DB, workItemCommentID WorkItemCommentID, opts ...WorkItemCommentSelectConfigOption) ([]WorkItemComment, error)

WorkItemCommentPaginatedByWorkItemCommentIDDesc returns a cursor-paginated list of WorkItemComment in Desc order.

func WorkItemCommentsByWorkItemID

func WorkItemCommentsByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemCommentSelectConfigOption) ([]WorkItemComment, error)

WorkItemCommentsByWorkItemID retrieves a row from 'public.work_item_comments' as a WorkItemComment.

Generated from index 'work_item_comments_work_item_id_idx'.

func (*WorkItemComment) Delete

func (wic *WorkItemComment) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItemComment from the database.

func (*WorkItemComment) FKUser_UserID

func (wic *WorkItemComment) FKUser_UserID(ctx context.Context, db DB) (*User, error)

FKUser_UserID returns the User associated with the WorkItemComment's (UserID).

Generated from foreign key 'work_item_comments_user_id_fkey'.

func (*WorkItemComment) FKWorkItem_WorkItemID

func (wic *WorkItemComment) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the WorkItemComment's (WorkItemID).

Generated from foreign key 'work_item_comments_work_item_id_fkey'.

func (*WorkItemComment) Insert

func (wic *WorkItemComment) Insert(ctx context.Context, db DB) (*WorkItemComment, error)

Insert inserts the WorkItemComment to the database.

func (*WorkItemComment) SetUpdateParams

func (wic *WorkItemComment) SetUpdateParams(params *WorkItemCommentUpdateParams)

SetUpdateParams updates public.work_item_comments struct fields with the specified params.

func (*WorkItemComment) Update

func (wic *WorkItemComment) Update(ctx context.Context, db DB) (*WorkItemComment, error)

Update updates a WorkItemComment in the database.

func (*WorkItemComment) Upsert

Upsert upserts a WorkItemComment in the database. Requires appropriate PK(s) to be set beforehand.

type WorkItemCommentCreateParams

type WorkItemCommentCreateParams struct {
	Message    string     `json:"message" required:"true" nullable:"false"`    // message
	UserID     UserID     `json:"userID" required:"true" nullable:"false"`     // user_id
	WorkItemID WorkItemID `json:"workItemID" required:"true" nullable:"false"` // work_item_id
}

WorkItemCommentCreateParams represents insert params for 'public.work_item_comments'.

type WorkItemCommentID

type WorkItemCommentID int

type WorkItemCommentJoins

type WorkItemCommentJoins struct {
	User     bool // O2O users
	WorkItem bool // O2O work_items
}

type WorkItemCommentOrderBy

type WorkItemCommentOrderBy string
const (
	WorkItemCommentCreatedAtDescNullsFirst WorkItemCommentOrderBy = " created_at DESC NULLS FIRST "
	WorkItemCommentCreatedAtDescNullsLast  WorkItemCommentOrderBy = " created_at DESC NULLS LAST "
	WorkItemCommentCreatedAtAscNullsFirst  WorkItemCommentOrderBy = " created_at ASC NULLS FIRST "
	WorkItemCommentCreatedAtAscNullsLast   WorkItemCommentOrderBy = " created_at ASC NULLS LAST "
	WorkItemCommentUpdatedAtDescNullsFirst WorkItemCommentOrderBy = " updated_at DESC NULLS FIRST "
	WorkItemCommentUpdatedAtDescNullsLast  WorkItemCommentOrderBy = " updated_at DESC NULLS LAST "
	WorkItemCommentUpdatedAtAscNullsFirst  WorkItemCommentOrderBy = " updated_at ASC NULLS FIRST "
	WorkItemCommentUpdatedAtAscNullsLast   WorkItemCommentOrderBy = " updated_at ASC NULLS LAST "
)

type WorkItemCommentSelectConfig

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

type WorkItemCommentSelectConfigOption

type WorkItemCommentSelectConfigOption func(*WorkItemCommentSelectConfig)

func WithWorkItemCommentFilters

func WithWorkItemCommentFilters(filters map[string][]any) WorkItemCommentSelectConfigOption

WithWorkItemCommentFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemCommentJoin

func WithWorkItemCommentJoin(joins WorkItemCommentJoins) WorkItemCommentSelectConfigOption

WithWorkItemCommentJoin joins with the given tables.

func WithWorkItemCommentLimit

func WithWorkItemCommentLimit(limit int) WorkItemCommentSelectConfigOption

WithWorkItemCommentLimit limits row selection.

func WithWorkItemCommentOrderBy

func WithWorkItemCommentOrderBy(rows ...WorkItemCommentOrderBy) WorkItemCommentSelectConfigOption

WithWorkItemCommentOrderBy orders results by the given columns.

type WorkItemCommentUpdateParams

type WorkItemCommentUpdateParams struct {
	Message    *string     `json:"message" nullable:"false"`    // message
	UserID     *UserID     `json:"userID" nullable:"false"`     // user_id
	WorkItemID *WorkItemID `json:"workItemID" nullable:"false"` // work_item_id
}

WorkItemCommentUpdateParams represents update params for 'public.work_item_comments'.

type WorkItemCreateParams

type WorkItemCreateParams struct {
	ClosedAt       *time.Time     `json:"closedAt"`                                        // closed_at
	Description    string         `json:"description" required:"true" nullable:"false"`    // description
	KanbanStepID   KanbanStepID   `json:"kanbanStepID" required:"true" nullable:"false"`   // kanban_step_id
	Metadata       map[string]any `json:"metadata" required:"true" nullable:"false"`       // metadata
	TargetDate     time.Time      `json:"targetDate" required:"true" nullable:"false"`     // target_date
	TeamID         TeamID         `json:"teamID" required:"true" nullable:"false"`         // team_id
	Title          string         `json:"title" required:"true" nullable:"false"`          // title
	WorkItemTypeID WorkItemTypeID `json:"workItemTypeID" required:"true" nullable:"false"` // work_item_type_id
}

WorkItemCreateParams represents insert params for 'public.work_items'.

type WorkItemID

type WorkItemID int

type WorkItemJoins

type WorkItemJoins struct {
	DemoTwoWorkItem  bool // O2O demo_two_work_items
	DemoWorkItem     bool // O2O demo_work_items
	TimeEntries      bool // M2O time_entries
	AssignedUsers    bool // M2M work_item_assigned_user
	WorkItemComments bool // M2O work_item_comments
	WorkItemTags     bool // M2M work_item_work_item_tag
	KanbanStep       bool // O2O kanban_steps
	Team             bool // O2O teams
	WorkItemType     bool // O2O work_item_types
}

type WorkItemOrderBy

type WorkItemOrderBy string
const (
	WorkItemClosedAtDescNullsFirst   WorkItemOrderBy = " closed_at DESC NULLS FIRST "
	WorkItemClosedAtDescNullsLast    WorkItemOrderBy = " closed_at DESC NULLS LAST "
	WorkItemClosedAtAscNullsFirst    WorkItemOrderBy = " closed_at ASC NULLS FIRST "
	WorkItemClosedAtAscNullsLast     WorkItemOrderBy = " closed_at ASC NULLS LAST "
	WorkItemCreatedAtDescNullsFirst  WorkItemOrderBy = " created_at DESC NULLS FIRST "
	WorkItemCreatedAtDescNullsLast   WorkItemOrderBy = " created_at DESC NULLS LAST "
	WorkItemCreatedAtAscNullsFirst   WorkItemOrderBy = " created_at ASC NULLS FIRST "
	WorkItemCreatedAtAscNullsLast    WorkItemOrderBy = " created_at ASC NULLS LAST "
	WorkItemDeletedAtDescNullsFirst  WorkItemOrderBy = " deleted_at DESC NULLS FIRST "
	WorkItemDeletedAtDescNullsLast   WorkItemOrderBy = " deleted_at DESC NULLS LAST "
	WorkItemDeletedAtAscNullsFirst   WorkItemOrderBy = " deleted_at ASC NULLS FIRST "
	WorkItemDeletedAtAscNullsLast    WorkItemOrderBy = " deleted_at ASC NULLS LAST "
	WorkItemTargetDateDescNullsFirst WorkItemOrderBy = " target_date DESC NULLS FIRST "
	WorkItemTargetDateDescNullsLast  WorkItemOrderBy = " target_date DESC NULLS LAST "
	WorkItemTargetDateAscNullsFirst  WorkItemOrderBy = " target_date ASC NULLS FIRST "
	WorkItemTargetDateAscNullsLast   WorkItemOrderBy = " target_date ASC NULLS LAST "
	WorkItemUpdatedAtDescNullsFirst  WorkItemOrderBy = " updated_at DESC NULLS FIRST "
	WorkItemUpdatedAtDescNullsLast   WorkItemOrderBy = " updated_at DESC NULLS LAST "
	WorkItemUpdatedAtAscNullsFirst   WorkItemOrderBy = " updated_at ASC NULLS FIRST "
	WorkItemUpdatedAtAscNullsLast    WorkItemOrderBy = " updated_at ASC NULLS LAST "
)

type WorkItemRole

type WorkItemRole string

WorkItemRole is the 'work_item_role' enum type from schema 'public'.

const (
	// WorkItemRolePreparer is the 'preparer' work_item_role.
	WorkItemRolePreparer WorkItemRole = "preparer"
	// WorkItemRoleReviewer is the 'reviewer' work_item_role.
	WorkItemRoleReviewer WorkItemRole = "reviewer"
)

WorkItemRole values.

func AllWorkItemRoleValues

func AllWorkItemRoleValues() []WorkItemRole

func (*WorkItemRole) Scan

func (wir *WorkItemRole) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface.

func (WorkItemRole) Value

func (wir WorkItemRole) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type WorkItemSelectConfig

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

type WorkItemSelectConfigOption

type WorkItemSelectConfigOption func(*WorkItemSelectConfig)

func WithDeletedWorkItemOnly

func WithDeletedWorkItemOnly() WorkItemSelectConfigOption

WithDeletedWorkItemOnly limits result to records marked as deleted.

func WithWorkItemFilters

func WithWorkItemFilters(filters map[string][]any) WorkItemSelectConfigOption

WithWorkItemFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemJoin

func WithWorkItemJoin(joins WorkItemJoins) WorkItemSelectConfigOption

WithWorkItemJoin joins with the given tables.

func WithWorkItemLimit

func WithWorkItemLimit(limit int) WorkItemSelectConfigOption

WithWorkItemLimit limits row selection.

func WithWorkItemOrderBy

func WithWorkItemOrderBy(rows ...WorkItemOrderBy) WorkItemSelectConfigOption

WithWorkItemOrderBy orders results by the given columns.

type WorkItemTag

type WorkItemTag struct {
	WorkItemTagID WorkItemTagID `json:"workItemTagID" db:"work_item_tag_id" required:"true" nullable:"false"`                           // work_item_tag_id
	ProjectID     ProjectID     `json:"projectID" db:"project_id" required:"true" nullable:"false"`                                     // project_id
	Name          string        `json:"name" db:"name" required:"true" nullable:"false"`                                                // name
	Description   string        `json:"description" db:"description" required:"true" nullable:"false"`                                  // description
	Color         string        `json:"color" db:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color

	ProjectJoin              *Project    `json:"-" db:"project_project_id" openapi-go:"ignore"`                 // O2O projects (generated from M2O)
	WorkItemTagWorkItemsJoin *[]WorkItem `json:"-" db:"work_item_work_item_tag_work_items" openapi-go:"ignore"` // M2M work_item_work_item_tag

}

WorkItemTag represents a row from 'public.work_item_tags'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItemTag

func CreateWorkItemTag(ctx context.Context, db DB, params *WorkItemTagCreateParams) (*WorkItemTag, error)

CreateWorkItemTag creates a new WorkItemTag in the database with the given params.

func WorkItemTagByNameProjectID

func WorkItemTagByNameProjectID(ctx context.Context, db DB, name string, projectID ProjectID, opts ...WorkItemTagSelectConfigOption) (*WorkItemTag, error)

WorkItemTagByNameProjectID retrieves a row from 'public.work_item_tags' as a WorkItemTag.

Generated from index 'work_item_tags_name_project_id_key'.

func WorkItemTagByWorkItemTagID

func WorkItemTagByWorkItemTagID(ctx context.Context, db DB, workItemTagID WorkItemTagID, opts ...WorkItemTagSelectConfigOption) (*WorkItemTag, error)

WorkItemTagByWorkItemTagID retrieves a row from 'public.work_item_tags' as a WorkItemTag.

Generated from index 'work_item_tags_pkey'.

func WorkItemTagPaginatedByProjectIDAsc

func WorkItemTagPaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagPaginatedByProjectIDAsc returns a cursor-paginated list of WorkItemTag in Asc order.

func WorkItemTagPaginatedByProjectIDDesc

func WorkItemTagPaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagPaginatedByProjectIDDesc returns a cursor-paginated list of WorkItemTag in Desc order.

func WorkItemTagPaginatedByWorkItemTagIDAsc

func WorkItemTagPaginatedByWorkItemTagIDAsc(ctx context.Context, db DB, workItemTagID WorkItemTagID, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagPaginatedByWorkItemTagIDAsc returns a cursor-paginated list of WorkItemTag in Asc order.

func WorkItemTagPaginatedByWorkItemTagIDDesc

func WorkItemTagPaginatedByWorkItemTagIDDesc(ctx context.Context, db DB, workItemTagID WorkItemTagID, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagPaginatedByWorkItemTagIDDesc returns a cursor-paginated list of WorkItemTag in Desc order.

func WorkItemTagsByName

func WorkItemTagsByName(ctx context.Context, db DB, name string, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagsByName retrieves a row from 'public.work_item_tags' as a WorkItemTag.

Generated from index 'work_item_tags_name_project_id_key'.

func WorkItemTagsByProjectID

func WorkItemTagsByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTagSelectConfigOption) ([]WorkItemTag, error)

WorkItemTagsByProjectID retrieves a row from 'public.work_item_tags' as a WorkItemTag.

Generated from index 'work_item_tags_name_project_id_key'.

func (*WorkItemTag) Delete

func (wit *WorkItemTag) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItemTag from the database.

func (*WorkItemTag) FKProject_ProjectID

func (wit *WorkItemTag) FKProject_ProjectID(ctx context.Context, db DB) (*Project, error)

FKProject_ProjectID returns the Project associated with the WorkItemTag's (ProjectID).

Generated from foreign key 'work_item_tags_project_id_fkey'.

func (*WorkItemTag) Insert

func (wit *WorkItemTag) Insert(ctx context.Context, db DB) (*WorkItemTag, error)

Insert inserts the WorkItemTag to the database.

func (*WorkItemTag) SetUpdateParams

func (wit *WorkItemTag) SetUpdateParams(params *WorkItemTagUpdateParams)

SetUpdateParams updates public.work_item_tags struct fields with the specified params.

func (*WorkItemTag) Update

func (wit *WorkItemTag) Update(ctx context.Context, db DB) (*WorkItemTag, error)

Update updates a WorkItemTag in the database.

func (*WorkItemTag) Upsert

func (wit *WorkItemTag) Upsert(ctx context.Context, db DB, params *WorkItemTagCreateParams) (*WorkItemTag, error)

Upsert upserts a WorkItemTag in the database. Requires appropriate PK(s) to be set beforehand.

type WorkItemTagCreateParams

type WorkItemTagCreateParams struct {
	Color       string    `json:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description string    `json:"description" required:"true" nullable:"false"`                                        // description
	Name        string    `json:"name" required:"true" nullable:"false"`                                               // name
	ProjectID   ProjectID `json:"projectID" nullable:"false"`                                                          // project_id
}

WorkItemTagCreateParams represents insert params for 'public.work_item_tags'.

type WorkItemTagID

type WorkItemTagID int

type WorkItemTagJoins

type WorkItemTagJoins struct {
	Project              bool // O2O projects
	WorkItemsWorkItemTag bool // M2M work_item_work_item_tag
}

type WorkItemTagOrderBy

type WorkItemTagOrderBy string

type WorkItemTagSelectConfig

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

type WorkItemTagSelectConfigOption

type WorkItemTagSelectConfigOption func(*WorkItemTagSelectConfig)

func WithWorkItemTagFilters

func WithWorkItemTagFilters(filters map[string][]any) WorkItemTagSelectConfigOption

WithWorkItemTagFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemTagJoin

func WithWorkItemTagJoin(joins WorkItemTagJoins) WorkItemTagSelectConfigOption

WithWorkItemTagJoin joins with the given tables.

func WithWorkItemTagLimit

func WithWorkItemTagLimit(limit int) WorkItemTagSelectConfigOption

WithWorkItemTagLimit limits row selection.

type WorkItemTagUpdateParams

type WorkItemTagUpdateParams struct {
	Color       *string    `json:"color" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description *string    `json:"description" nullable:"false"`                                        // description
	Name        *string    `json:"name" nullable:"false"`                                               // name
	ProjectID   *ProjectID `json:"projectID" nullable:"false"`                                          // project_id
}

WorkItemTagUpdateParams represents update params for 'public.work_item_tags'.

type WorkItemType

type WorkItemType struct {
	WorkItemTypeID WorkItemTypeID `json:"workItemTypeID" db:"work_item_type_id" required:"true" nullable:"false"`                         // work_item_type_id
	ProjectID      ProjectID      `json:"projectID" db:"project_id" required:"true" nullable:"false"`                                     // project_id
	Name           string         `json:"name" db:"name" required:"true" nullable:"false"`                                                // name
	Description    string         `json:"description" db:"description" required:"true" nullable:"false"`                                  // description
	Color          string         `json:"color" db:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color

	ProjectJoin *Project `json:"-" db:"project_project_id" openapi-go:"ignore"` // O2O projects (generated from M2O)

}

WorkItemType represents a row from 'public.work_item_types'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItemType

func CreateWorkItemType(ctx context.Context, db DB, params *WorkItemTypeCreateParams) (*WorkItemType, error)

CreateWorkItemType creates a new WorkItemType in the database with the given params.

func WorkItemTypeByNameProjectID

func WorkItemTypeByNameProjectID(ctx context.Context, db DB, name string, projectID ProjectID, opts ...WorkItemTypeSelectConfigOption) (*WorkItemType, error)

WorkItemTypeByNameProjectID retrieves a row from 'public.work_item_types' as a WorkItemType.

Generated from index 'work_item_types_name_project_id_key'.

func WorkItemTypeByWorkItemTypeID

func WorkItemTypeByWorkItemTypeID(ctx context.Context, db DB, workItemTypeID WorkItemTypeID, opts ...WorkItemTypeSelectConfigOption) (*WorkItemType, error)

WorkItemTypeByWorkItemTypeID retrieves a row from 'public.work_item_types' as a WorkItemType.

Generated from index 'work_item_types_pkey'.

func WorkItemTypePaginatedByProjectIDAsc

func WorkItemTypePaginatedByProjectIDAsc(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypePaginatedByProjectIDAsc returns a cursor-paginated list of WorkItemType in Asc order.

func WorkItemTypePaginatedByProjectIDDesc

func WorkItemTypePaginatedByProjectIDDesc(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypePaginatedByProjectIDDesc returns a cursor-paginated list of WorkItemType in Desc order.

func WorkItemTypePaginatedByWorkItemTypeIDAsc

func WorkItemTypePaginatedByWorkItemTypeIDAsc(ctx context.Context, db DB, workItemTypeID WorkItemTypeID, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypePaginatedByWorkItemTypeIDAsc returns a cursor-paginated list of WorkItemType in Asc order.

func WorkItemTypePaginatedByWorkItemTypeIDDesc

func WorkItemTypePaginatedByWorkItemTypeIDDesc(ctx context.Context, db DB, workItemTypeID WorkItemTypeID, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypePaginatedByWorkItemTypeIDDesc returns a cursor-paginated list of WorkItemType in Desc order.

func WorkItemTypesByName

func WorkItemTypesByName(ctx context.Context, db DB, name string, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypesByName retrieves a row from 'public.work_item_types' as a WorkItemType.

Generated from index 'work_item_types_name_project_id_key'.

func WorkItemTypesByProjectID

func WorkItemTypesByProjectID(ctx context.Context, db DB, projectID ProjectID, opts ...WorkItemTypeSelectConfigOption) ([]WorkItemType, error)

WorkItemTypesByProjectID retrieves a row from 'public.work_item_types' as a WorkItemType.

Generated from index 'work_item_types_name_project_id_key'.

func (*WorkItemType) Delete

func (wit *WorkItemType) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItemType from the database.

func (*WorkItemType) FKProject_ProjectID

func (wit *WorkItemType) FKProject_ProjectID(ctx context.Context, db DB) (*Project, error)

FKProject_ProjectID returns the Project associated with the WorkItemType's (ProjectID).

Generated from foreign key 'work_item_types_project_id_fkey'.

func (*WorkItemType) Insert

func (wit *WorkItemType) Insert(ctx context.Context, db DB) (*WorkItemType, error)

Insert inserts the WorkItemType to the database.

func (*WorkItemType) SetUpdateParams

func (wit *WorkItemType) SetUpdateParams(params *WorkItemTypeUpdateParams)

SetUpdateParams updates public.work_item_types struct fields with the specified params.

func (*WorkItemType) Update

func (wit *WorkItemType) Update(ctx context.Context, db DB) (*WorkItemType, error)

Update updates a WorkItemType in the database.

func (*WorkItemType) Upsert

func (wit *WorkItemType) Upsert(ctx context.Context, db DB, params *WorkItemTypeCreateParams) (*WorkItemType, error)

Upsert upserts a WorkItemType in the database. Requires appropriate PK(s) to be set beforehand.

type WorkItemTypeCreateParams

type WorkItemTypeCreateParams struct {
	Color       string    `json:"color" required:"true" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description string    `json:"description" required:"true" nullable:"false"`                                        // description
	Name        string    `json:"name" required:"true" nullable:"false"`                                               // name
	ProjectID   ProjectID `json:"projectID" nullable:"false"`                                                          // project_id
}

WorkItemTypeCreateParams represents insert params for 'public.work_item_types'.

type WorkItemTypeID

type WorkItemTypeID int

type WorkItemTypeJoins

type WorkItemTypeJoins struct {
	Project bool // O2O projects
}

type WorkItemTypeOrderBy

type WorkItemTypeOrderBy string

type WorkItemTypeSelectConfig

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

type WorkItemTypeSelectConfigOption

type WorkItemTypeSelectConfigOption func(*WorkItemTypeSelectConfig)

func WithWorkItemTypeFilters

func WithWorkItemTypeFilters(filters map[string][]any) WorkItemTypeSelectConfigOption

WithWorkItemTypeFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemTypeJoin

func WithWorkItemTypeJoin(joins WorkItemTypeJoins) WorkItemTypeSelectConfigOption

WithWorkItemTypeJoin joins with the given tables.

func WithWorkItemTypeLimit

func WithWorkItemTypeLimit(limit int) WorkItemTypeSelectConfigOption

WithWorkItemTypeLimit limits row selection.

type WorkItemTypeUpdateParams

type WorkItemTypeUpdateParams struct {
	Color       *string    `json:"color" nullable:"false" pattern:"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$"` // color
	Description *string    `json:"description" nullable:"false"`                                        // description
	Name        *string    `json:"name" nullable:"false"`                                               // name
	ProjectID   *ProjectID `json:"projectID" nullable:"false"`                                          // project_id
}

WorkItemTypeUpdateParams represents update params for 'public.work_item_types'.

type WorkItemUpdateParams

type WorkItemUpdateParams struct {
	ClosedAt       **time.Time     `json:"closedAt"`                        // closed_at
	Description    *string         `json:"description" nullable:"false"`    // description
	KanbanStepID   *KanbanStepID   `json:"kanbanStepID" nullable:"false"`   // kanban_step_id
	Metadata       *map[string]any `json:"metadata" nullable:"false"`       // metadata
	TargetDate     *time.Time      `json:"targetDate" nullable:"false"`     // target_date
	TeamID         *TeamID         `json:"teamID" nullable:"false"`         // team_id
	Title          *string         `json:"title" nullable:"false"`          // title
	WorkItemTypeID *WorkItemTypeID `json:"workItemTypeID" nullable:"false"` // work_item_type_id
}

WorkItemUpdateParams represents update params for 'public.work_items'.

type WorkItemWorkItemTag

type WorkItemWorkItemTag struct {
	WorkItemTagID WorkItemTagID `json:"workItemTagID" db:"work_item_tag_id" required:"true" nullable:"false"` // work_item_tag_id
	WorkItemID    WorkItemID    `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`        // work_item_id

	WorkItemWorkItemTagsJoin *[]WorkItemTag `json:"-" db:"work_item_work_item_tag_work_item_tags" openapi-go:"ignore"` // M2M work_item_work_item_tag
	WorkItemTagWorkItemsJoin *[]WorkItem    `json:"-" db:"work_item_work_item_tag_work_items" openapi-go:"ignore"`     // M2M work_item_work_item_tag

}

WorkItemWorkItemTag represents a row from 'public.work_item_work_item_tag'. Change properties via SQL column comments, joined with " && ":

  • "properties":<p1>,<p2>,...
  • private to exclude a field from JSON.
  • not-required to make a schema field not required.
  • "type":<pkg.type> to override the type annotation. An openapi schema named <type> must exist.
  • "cardinality":<O2O|M2O|M2M> to generate/override joins explicitly. Only O2O is inferred.
  • "tags":<tags> to append literal struct tag strings.

func CreateWorkItemWorkItemTag

func CreateWorkItemWorkItemTag(ctx context.Context, db DB, params *WorkItemWorkItemTagCreateParams) (*WorkItemWorkItemTag, error)

CreateWorkItemWorkItemTag creates a new WorkItemWorkItemTag in the database with the given params.

func WorkItemWorkItemTagByWorkItemIDWorkItemTagID

func WorkItemWorkItemTagByWorkItemIDWorkItemTagID(ctx context.Context, db DB, workItemID WorkItemID, workItemTagID WorkItemTagID, opts ...WorkItemWorkItemTagSelectConfigOption) (*WorkItemWorkItemTag, error)

WorkItemWorkItemTagByWorkItemIDWorkItemTagID retrieves a row from 'public.work_item_work_item_tag' as a WorkItemWorkItemTag.

Generated from index 'work_item_work_item_tag_pkey'.

func WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDAsc

func WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDAsc(ctx context.Context, db DB, workItemTagID WorkItemTagID, workItemID WorkItemID, opts ...WorkItemWorkItemTagSelectConfigOption) ([]WorkItemWorkItemTag, error)

WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDAsc returns a cursor-paginated list of WorkItemWorkItemTag in Asc order.

func WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDDesc

func WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDDesc(ctx context.Context, db DB, workItemTagID WorkItemTagID, workItemID WorkItemID, opts ...WorkItemWorkItemTagSelectConfigOption) ([]WorkItemWorkItemTag, error)

WorkItemWorkItemTagPaginatedByWorkItemTagIDWorkItemIDDesc returns a cursor-paginated list of WorkItemWorkItemTag in Desc order.

func WorkItemWorkItemTagsByWorkItemID

func WorkItemWorkItemTagsByWorkItemID(ctx context.Context, db DB, workItemID WorkItemID, opts ...WorkItemWorkItemTagSelectConfigOption) ([]WorkItemWorkItemTag, error)

WorkItemWorkItemTagsByWorkItemID retrieves a row from 'public.work_item_work_item_tag' as a WorkItemWorkItemTag.

Generated from index 'work_item_work_item_tag_pkey'.

func WorkItemWorkItemTagsByWorkItemTagID

func WorkItemWorkItemTagsByWorkItemTagID(ctx context.Context, db DB, workItemTagID WorkItemTagID, opts ...WorkItemWorkItemTagSelectConfigOption) ([]WorkItemWorkItemTag, error)

WorkItemWorkItemTagsByWorkItemTagID retrieves a row from 'public.work_item_work_item_tag' as a WorkItemWorkItemTag.

Generated from index 'work_item_work_item_tag_pkey'.

func WorkItemWorkItemTagsByWorkItemTagIDWorkItemID

func WorkItemWorkItemTagsByWorkItemTagIDWorkItemID(ctx context.Context, db DB, workItemTagID WorkItemTagID, workItemID WorkItemID, opts ...WorkItemWorkItemTagSelectConfigOption) ([]WorkItemWorkItemTag, error)

WorkItemWorkItemTagsByWorkItemTagIDWorkItemID retrieves a row from 'public.work_item_work_item_tag' as a WorkItemWorkItemTag.

Generated from index 'work_item_work_item_tag_work_item_tag_id_work_item_id_idx'.

func (*WorkItemWorkItemTag) Delete

func (wiwit *WorkItemWorkItemTag) Delete(ctx context.Context, db DB) error

Delete deletes the WorkItemWorkItemTag from the database.

func (*WorkItemWorkItemTag) FKWorkItemTag_WorkItemTagID

func (wiwit *WorkItemWorkItemTag) FKWorkItemTag_WorkItemTagID(ctx context.Context, db DB) (*WorkItemTag, error)

FKWorkItemTag_WorkItemTagID returns the WorkItemTag associated with the WorkItemWorkItemTag's (WorkItemTagID).

Generated from foreign key 'work_item_work_item_tag_work_item_tag_id_fkey'.

func (*WorkItemWorkItemTag) FKWorkItem_WorkItemID

func (wiwit *WorkItemWorkItemTag) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*WorkItem, error)

FKWorkItem_WorkItemID returns the WorkItem associated with the WorkItemWorkItemTag's (WorkItemID).

Generated from foreign key 'work_item_work_item_tag_work_item_id_fkey'.

func (*WorkItemWorkItemTag) Insert

func (wiwit *WorkItemWorkItemTag) Insert(ctx context.Context, db DB) (*WorkItemWorkItemTag, error)

Insert inserts the WorkItemWorkItemTag to the database.

func (*WorkItemWorkItemTag) SetUpdateParams

func (wiwit *WorkItemWorkItemTag) SetUpdateParams(params *WorkItemWorkItemTagUpdateParams)

SetUpdateParams updates public.work_item_work_item_tag struct fields with the specified params.

type WorkItemWorkItemTagCreateParams

type WorkItemWorkItemTagCreateParams struct {
	WorkItemID    WorkItemID    `json:"workItemID" required:"true" nullable:"false"`    // work_item_id
	WorkItemTagID WorkItemTagID `json:"workItemTagID" required:"true" nullable:"false"` // work_item_tag_id
}

WorkItemWorkItemTagCreateParams represents insert params for 'public.work_item_work_item_tag'.

type WorkItemWorkItemTagJoins

type WorkItemWorkItemTagJoins struct {
	WorkItemTags         bool // M2M work_item_work_item_tag
	WorkItemsWorkItemTag bool // M2M work_item_work_item_tag
}

type WorkItemWorkItemTagOrderBy

type WorkItemWorkItemTagOrderBy string

type WorkItemWorkItemTagSelectConfig

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

type WorkItemWorkItemTagSelectConfigOption

type WorkItemWorkItemTagSelectConfigOption func(*WorkItemWorkItemTagSelectConfig)

func WithWorkItemWorkItemTagFilters

func WithWorkItemWorkItemTagFilters(filters map[string][]any) WorkItemWorkItemTagSelectConfigOption

WithWorkItemWorkItemTagFilters adds the given filters, which can be dynamically parameterized with $i to prevent SQL injection. Example:

filters := map[string][]any{
	"NOT (col.name = any ($i))": {[]string{"excl_name_1", "excl_name_2"}},
	`(col.created_at > $i OR
	col.is_closed = $i)`: {time.Now().Add(-24 * time.Hour), true},
}

func WithWorkItemWorkItemTagJoin

func WithWorkItemWorkItemTagJoin(joins WorkItemWorkItemTagJoins) WorkItemWorkItemTagSelectConfigOption

WithWorkItemWorkItemTagJoin joins with the given tables.

func WithWorkItemWorkItemTagLimit

func WithWorkItemWorkItemTagLimit(limit int) WorkItemWorkItemTagSelectConfigOption

WithWorkItemWorkItemTagLimit limits row selection.

type WorkItemWorkItemTagUpdateParams

type WorkItemWorkItemTagUpdateParams struct {
	WorkItemID    *WorkItemID    `json:"workItemID" nullable:"false"`    // work_item_id
	WorkItemTagID *WorkItemTagID `json:"workItemTagID" nullable:"false"` // work_item_tag_id
}

WorkItemWorkItemTagUpdateParams represents update params for 'public.work_item_work_item_tag'.

type WorkItem__WIAU_User

type WorkItem__WIAU_User struct {
	WorkItem WorkItem            `json:"workItem" db:"work_items" required:"true"`
	Role     models.WorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

WorkItem__WIAU_User represents a M2M join against "public.work_item_assigned_user"

type WorkItem__WIAU_WorkItemAssignedUser

type WorkItem__WIAU_WorkItemAssignedUser struct {
	WorkItem WorkItem            `json:"workItem" db:"work_items" required:"true"`
	Role     models.WorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

WorkItem__WIAU_WorkItemAssignedUser represents a M2M join against "public.work_item_assigned_user"

type XoError

type XoError struct {
	Entity string
	Err    error
}

func (*XoError) Error

func (e *XoError) Error() string

Error satisfies the error interface.

func (*XoError) Unwrap

func (err *XoError) Unwrap() error

Unwrap satisfies the unwrap interface.

Directories

Path Synopsis
v

Jump to

Keyboard shortcuts

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