got

package
v0.0.0-...-5d14948 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EntityFields = map[TableEntity]map[string]DbField{}
View Source
var XoTestsCacheEntityFields = map[XoTestsCacheTableEntity]map[string]DbField{}
View Source
var XoTestsEntityFields = map[XoTestsTableEntity]map[string]DbField{
	XoTestsTableEntityXoTestsBook: {
		"bookID": DbField{Type: ColumnSimpleTypeInteger, Db: "book_id", Nullable: false, Public: true},
		"name":   DbField{Type: ColumnSimpleTypeString, Db: "name", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsBookAuthor: {
		"authorID":  DbField{Type: ColumnSimpleTypeString, Db: "author_id", Nullable: false, Public: true},
		"bookID":    DbField{Type: ColumnSimpleTypeInteger, Db: "book_id", Nullable: false, Public: true},
		"pseudonym": DbField{Type: ColumnSimpleTypeString, Db: "pseudonym", Nullable: true, Public: true},
	},
	XoTestsTableEntityXoTestsBookAuthorsSurrogateKey: {
		"authorID":                  DbField{Type: ColumnSimpleTypeString, Db: "author_id", Nullable: false, Public: true},
		"bookAuthorsSurrogateKeyID": DbField{Type: ColumnSimpleTypeInteger, Db: "book_authors_surrogate_key_id", Nullable: false, Public: true},
		"bookID":                    DbField{Type: ColumnSimpleTypeInteger, Db: "book_id", Nullable: false, Public: true},
		"pseudonym":                 DbField{Type: ColumnSimpleTypeString, Db: "pseudonym", Nullable: true, Public: true},
	},
	XoTestsTableEntityXoTestsBookReview: {
		"bookID":       DbField{Type: ColumnSimpleTypeInteger, Db: "book_id", Nullable: false, Public: true},
		"bookReviewID": DbField{Type: ColumnSimpleTypeInteger, Db: "book_review_id", Nullable: false, Public: true},
		"reviewer":     DbField{Type: ColumnSimpleTypeString, Db: "reviewer", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsBookSeller: {
		"bookID": DbField{Type: ColumnSimpleTypeInteger, Db: "book_id", Nullable: false, Public: true},
		"seller": DbField{Type: ColumnSimpleTypeString, Db: "seller", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsCacheDemoWorkItem: {
		"teamID":     DbField{Type: ColumnSimpleTypeInteger, Db: "team_id", Nullable: false, Public: true},
		"title":      DbField{Type: ColumnSimpleTypeString, Db: "title", Nullable: true, Public: true},
		"workItemID": DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsDemoWorkItem: {
		"checked":    DbField{Type: ColumnSimpleTypeBoolean, Db: "checked", Nullable: false, Public: true},
		"workItemID": DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsDummyJoin: {
		"dummyJoinID": DbField{Type: ColumnSimpleTypeInteger, Db: "dummy_join_id", Nullable: false, Public: true},
		"name":        DbField{Type: ColumnSimpleTypeString, Db: "name", Nullable: true, Public: true},
	},
	XoTestsTableEntityXoTestsNotification: {
		"body":           DbField{Type: ColumnSimpleTypeString, Db: "body", Nullable: false, Public: true},
		"notificationID": DbField{Type: ColumnSimpleTypeInteger, Db: "notification_id", Nullable: false, Public: true},
		"receiver":       DbField{Type: ColumnSimpleTypeString, Db: "receiver", Nullable: true, Public: true},
		"sender":         DbField{Type: ColumnSimpleTypeString, Db: "sender", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsPagElement: {
		"createdAt":          DbField{Type: ColumnSimpleTypeDateTime, Db: "created_at", Nullable: false, Public: true},
		"dummy":              DbField{Type: ColumnSimpleTypeInteger, Db: "dummy", Nullable: true, Public: true},
		"name":               DbField{Type: ColumnSimpleTypeString, Db: "name", Nullable: false, Public: true},
		"paginatedElementID": DbField{Type: ColumnSimpleTypeString, Db: "paginated_element_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsTeam: {
		"name":   DbField{Type: ColumnSimpleTypeString, Db: "name", Nullable: false, Public: true},
		"teamID": DbField{Type: ColumnSimpleTypeInteger, Db: "team_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsTimeEntry: {
		"start":       DbField{Type: ColumnSimpleTypeDateTime, Db: "start", Nullable: false, Public: true},
		"timeEntryID": DbField{Type: ColumnSimpleTypeInteger, Db: "time_entry_id", Nullable: false, Public: true},
		"workItemID":  DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: true, Public: true},
	},
	XoTestsTableEntityXoTestsUser: {
		"apiKeyID":  DbField{Type: ColumnSimpleTypeInteger, Db: "api_key_id", Nullable: true, Public: true},
		"createdAt": DbField{Type: ColumnSimpleTypeDateTime, Db: "created_at", Nullable: false, Public: true},
		"deletedAt": DbField{Type: ColumnSimpleTypeDateTime, Db: "deleted_at", Nullable: true, Public: true},
		"name":      DbField{Type: ColumnSimpleTypeString, Db: "name", Nullable: false, Public: true},
		"userID":    DbField{Type: ColumnSimpleTypeString, Db: "user_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsUserAPIKey: {
		"apiKey":       DbField{Type: ColumnSimpleTypeString, Db: "api_key", Nullable: false, Public: true},
		"expiresOn":    DbField{Type: ColumnSimpleTypeDateTime, Db: "expires_on", Nullable: false, Public: true},
		"userAPIKeyID": DbField{Type: ColumnSimpleTypeInteger, Db: "user_api_key_id", Nullable: false, Public: true},
		"userID":       DbField{Type: ColumnSimpleTypeString, Db: "user_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsWorkItem: {
		"description": DbField{Type: ColumnSimpleTypeString, Db: "description", Nullable: true, Public: true},
		"teamID":      DbField{Type: ColumnSimpleTypeInteger, Db: "team_id", Nullable: false, Public: true},
		"title":       DbField{Type: ColumnSimpleTypeString, Db: "title", Nullable: true, Public: true},
		"workItemID":  DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsWorkItemAssignee: {
		"assignee":   DbField{Type: ColumnSimpleTypeString, Db: "assignee", Nullable: false, Public: true},
		"workItemID": DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: false, Public: true},
	},
	XoTestsTableEntityXoTestsWorkItemComment: {
		"createdAt":         DbField{Type: ColumnSimpleTypeDateTime, Db: "created_at", Nullable: false, Public: true},
		"message":           DbField{Type: ColumnSimpleTypeString, Db: "message", Nullable: false, Public: true},
		"updatedAt":         DbField{Type: ColumnSimpleTypeDateTime, Db: "updated_at", Nullable: false, Public: true},
		"userID":            DbField{Type: ColumnSimpleTypeString, Db: "user_id", Nullable: false, Public: true},
		"workItemCommentID": DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_comment_id", Nullable: false, Public: true},
		"workItemID":        DbField{Type: ColumnSimpleTypeInteger, Db: "work_item_id", Nullable: false, Public: true},
	},
}

Functions

func Errorf

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

Errorf logs an error message using the package error logger.

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 ColumnSimpleType

type ColumnSimpleType string
const (
	ColumnSimpleTypeDateTime ColumnSimpleType = "date-time"
	ColumnSimpleTypeInteger  ColumnSimpleType = "integer"
	ColumnSimpleTypeNumber   ColumnSimpleType = "number"
	ColumnSimpleTypeString   ColumnSimpleType = "string"
	ColumnSimpleTypeBoolean  ColumnSimpleType = "boolean"
	ColumnSimpleTypeArray    ColumnSimpleType = "array"
	ColumnSimpleTypeObject   ColumnSimpleType = "object"
)

type Cursor

type Cursor struct {
	Column    string
	Value     interface{}
	Direction Direction
}

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 DbField

type DbField struct {
	// Type is one of: string, number, integer, boolean, date-time
	// Arrays and objects are ignored for default filter generation
	Type ColumnSimpleType `json:"type"`
	// Db is the corresponding db column name
	Db       string `json:"db"`
	Nullable bool   `json:"nullable"`
	Public   bool   `json:"public"`
}

DbField shows db column information.

type Direction

type Direction string
const (
	DirectionAsc  Direction = "asc"
	DirectionDesc Direction = "desc"
)

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 ErrInvalidXoTestsWorkItemRole

type ErrInvalidXoTestsWorkItemRole string

ErrInvalidXoTestsWorkItemRole is the invalid XoTestsWorkItemRole error.

func (ErrInvalidXoTestsWorkItemRole) Error

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 PaginationCursor

type PaginationCursor struct {
	Column    string       `json:"column"`
	Direction Direction    `json:"direction"`
	Value     *interface{} `json:"value"`
}

type TableEntity

type TableEntity string

type Trigger

type Trigger struct{}

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.

type XoTestsBook

type XoTestsBook struct {
	BookID XoTestsBookID `json:"bookID" db:"book_id" required:"true" nullable:"false"` // book_id
	Name   string        `json:"name" db:"name" required:"true" nullable:"false"`      // name

	AuthorsJoin     *[]XoTestsBookM2MAuthorBA   `json:"-" db:"book_authors_authors"`               // M2M book_authors
	AuthorsBASKJoin *[]XoTestsBookM2MAuthorBASK `json:"-" db:"book_authors_surrogate_key_authors"` // M2M book_authors_surrogate_key
	BookReviewsJoin *[]XoTestsBookReview        `json:"-" db:"book_reviews"`                       // M2O books
	SellersJoin     *[]XoTestsUser              `json:"-" db:"book_sellers_sellers"`               // M2M book_sellers
}

XoTestsBook represents a row from 'xo_tests.books'.

func CreateXoTestsBook

func CreateXoTestsBook(ctx context.Context, db DB, params *XoTestsBookCreateParams) (*XoTestsBook, error)

CreateXoTestsBook creates a new XoTestsBook in the database with the given params.

func XoTestsBookByBookID

func XoTestsBookByBookID(ctx context.Context, db DB, bookID XoTestsBookID, opts ...XoTestsBookSelectConfigOption) (*XoTestsBook, error)

XoTestsBookByBookID retrieves a row from 'xo_tests.books' as a XoTestsBook.

Generated from index 'books_pkey'.

func XoTestsBookPaginated

func XoTestsBookPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsBookSelectConfigOption) ([]XoTestsBook, error)

XoTestsBookPaginated returns a cursor-paginated list of XoTestsBook. At least one cursor is required.

func (*XoTestsBook) Delete

func (xtb *XoTestsBook) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsBook from the database.

func (*XoTestsBook) Insert

func (xtb *XoTestsBook) Insert(ctx context.Context, db DB) (*XoTestsBook, error)

Insert inserts the XoTestsBook to the database.

func (*XoTestsBook) SetUpdateParams

func (xtb *XoTestsBook) SetUpdateParams(params *XoTestsBookUpdateParams)

SetUpdateParams updates xo_tests.books struct fields with the specified params.

func (*XoTestsBook) Update

func (xtb *XoTestsBook) Update(ctx context.Context, db DB) (*XoTestsBook, error)

Update updates a XoTestsBook in the database.

func (*XoTestsBook) Upsert

func (xtb *XoTestsBook) Upsert(ctx context.Context, db DB, params *XoTestsBookCreateParams) (*XoTestsBook, error)

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

type XoTestsBookAuthor

type XoTestsBookAuthor struct {
	BookID    XoTestsBookID `json:"bookID" db:"book_id" required:"true" nullable:"false"`     // book_id
	AuthorID  XoTestsUserID `json:"authorID" db:"author_id" required:"true" nullable:"false"` // author_id
	Pseudonym *string       `json:"pseudonym" db:"pseudonym"`                                 // pseudonym

	BooksJoin   *[]XoTestsBookAuthorM2MBookBA   `json:"-" db:"book_authors_books"`   // M2M book_authors
	AuthorsJoin *[]XoTestsBookAuthorM2MAuthorBA `json:"-" db:"book_authors_authors"` // M2M book_authors
}

XoTestsBookAuthor represents a row from 'xo_tests.book_authors'.

func CreateXoTestsBookAuthor

func CreateXoTestsBookAuthor(ctx context.Context, db DB, params *XoTestsBookAuthorCreateParams) (*XoTestsBookAuthor, error)

CreateXoTestsBookAuthor creates a new XoTestsBookAuthor in the database with the given params.

func XoTestsBookAuthorByBookIDAuthorID

func XoTestsBookAuthorByBookIDAuthorID(ctx context.Context, db DB, bookID XoTestsBookID, authorID XoTestsUserID, opts ...XoTestsBookAuthorSelectConfigOption) (*XoTestsBookAuthor, error)

XoTestsBookAuthorByBookIDAuthorID retrieves a row from 'xo_tests.book_authors' as a XoTestsBookAuthor.

Generated from index 'book_authors_pkey'.

func XoTestsBookAuthorPaginated

func XoTestsBookAuthorPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsBookAuthorSelectConfigOption) ([]XoTestsBookAuthor, error)

XoTestsBookAuthorPaginated returns a cursor-paginated list of XoTestsBookAuthor. At least one cursor is required.

func XoTestsBookAuthorsByAuthorID

func XoTestsBookAuthorsByAuthorID(ctx context.Context, db DB, authorID XoTestsUserID, opts ...XoTestsBookAuthorSelectConfigOption) ([]XoTestsBookAuthor, error)

XoTestsBookAuthorsByAuthorID retrieves a row from 'xo_tests.book_authors' as a XoTestsBookAuthor.

Generated from index 'book_authors_pkey'.

func XoTestsBookAuthorsByBookID

func XoTestsBookAuthorsByBookID(ctx context.Context, db DB, bookID XoTestsBookID, opts ...XoTestsBookAuthorSelectConfigOption) ([]XoTestsBookAuthor, error)

XoTestsBookAuthorsByBookID retrieves a row from 'xo_tests.book_authors' as a XoTestsBookAuthor.

Generated from index 'book_authors_pkey'.

func (*XoTestsBookAuthor) Delete

func (xtba *XoTestsBookAuthor) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsBookAuthor from the database.

func (*XoTestsBookAuthor) FKBook_BookID

func (xtba *XoTestsBookAuthor) FKBook_BookID(ctx context.Context, db DB) (*XoTestsBook, error)

FKBook_BookID returns the Book associated with the XoTestsBookAuthor's (BookID).

Generated from foreign key 'book_authors_book_id_fkey'.

func (*XoTestsBookAuthor) FKUser_AuthorID

func (xtba *XoTestsBookAuthor) FKUser_AuthorID(ctx context.Context, db DB) (*XoTestsUser, error)

FKUser_AuthorID returns the User associated with the XoTestsBookAuthor's (AuthorID).

Generated from foreign key 'book_authors_author_id_fkey'.

func (*XoTestsBookAuthor) Insert

func (xtba *XoTestsBookAuthor) Insert(ctx context.Context, db DB) (*XoTestsBookAuthor, error)

Insert inserts the XoTestsBookAuthor to the database.

func (*XoTestsBookAuthor) SetUpdateParams

func (xtba *XoTestsBookAuthor) SetUpdateParams(params *XoTestsBookAuthorUpdateParams)

SetUpdateParams updates xo_tests.book_authors struct fields with the specified params.

func (*XoTestsBookAuthor) Update

func (xtba *XoTestsBookAuthor) Update(ctx context.Context, db DB) (*XoTestsBookAuthor, error)

Update updates a XoTestsBookAuthor in the database.

func (*XoTestsBookAuthor) Upsert

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

type XoTestsBookAuthorCreateParams

type XoTestsBookAuthorCreateParams struct {
	AuthorID  XoTestsUserID `json:"authorID" required:"true" nullable:"false"` // author_id
	BookID    XoTestsBookID `json:"bookID" required:"true" nullable:"false"`   // book_id
	Pseudonym *string       `json:"pseudonym"`                                 // pseudonym
}

XoTestsBookAuthorCreateParams represents insert params for 'xo_tests.book_authors'.

func (XoTestsBookAuthorCreateParams) GetAuthorID

func (XoTestsBookAuthorCreateParams) GetBookID

func (XoTestsBookAuthorCreateParams) GetPseudonym

func (p XoTestsBookAuthorCreateParams) GetPseudonym() *string

type XoTestsBookAuthorJoins

type XoTestsBookAuthorJoins struct {
	Books   bool `json:"books" required:"true" nullable:"false"`   // M2M book_authors
	Authors bool `json:"authors" required:"true" nullable:"false"` // M2M book_authors
}

type XoTestsBookAuthorM2MAuthorBA

type XoTestsBookAuthorM2MAuthorBA struct {
	User      XoTestsUser `json:"user" db:"users" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookAuthorM2MAuthorBA represents a M2M join against "xo_tests.book_authors"

type XoTestsBookAuthorM2MBookBA

type XoTestsBookAuthorM2MBookBA struct {
	Book      XoTestsBook `json:"book" db:"books" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookAuthorM2MBookBA represents a M2M join against "xo_tests.book_authors"

type XoTestsBookAuthorParams

type XoTestsBookAuthorParams interface {
	GetAuthorID() *XoTestsUserID
	GetBookID() *XoTestsBookID
	GetPseudonym() *string
}

XoTestsBookAuthorParams represents common params for both insert and update of 'xo_tests.book_authors'.

type XoTestsBookAuthorSelectConfig

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

type XoTestsBookAuthorSelectConfigOption

type XoTestsBookAuthorSelectConfigOption func(*XoTestsBookAuthorSelectConfig)

func WithXoTestsBookAuthorFilters

func WithXoTestsBookAuthorFilters(filters map[string][]any) XoTestsBookAuthorSelectConfigOption

WithXoTestsBookAuthorFilters adds the given WHERE clause conditions, 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 WithXoTestsBookAuthorHavingClause

func WithXoTestsBookAuthorHavingClause(conditions map[string][]any) XoTestsBookAuthorSelectConfigOption

WithXoTestsBookAuthorHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsBookAuthorJoin

func WithXoTestsBookAuthorJoin(joins XoTestsBookAuthorJoins) XoTestsBookAuthorSelectConfigOption

WithXoTestsBookAuthorJoin joins with the given tables.

func WithXoTestsBookAuthorLimit

func WithXoTestsBookAuthorLimit(limit int) XoTestsBookAuthorSelectConfigOption

WithXoTestsBookAuthorLimit limits row selection.

func WithXoTestsBookAuthorOrderBy

func WithXoTestsBookAuthorOrderBy(rows map[string]*Direction) XoTestsBookAuthorSelectConfigOption

WithXoTestsBookAuthorOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsBookAuthorUpdateParams

type XoTestsBookAuthorUpdateParams struct {
	AuthorID  *XoTestsUserID `json:"authorID" nullable:"false"` // author_id
	BookID    *XoTestsBookID `json:"bookID" nullable:"false"`   // book_id
	Pseudonym **string       `json:"pseudonym"`                 // pseudonym
}

XoTestsBookAuthorUpdateParams represents update params for 'xo_tests.book_authors'.

func (XoTestsBookAuthorUpdateParams) GetAuthorID

func (XoTestsBookAuthorUpdateParams) GetBookID

func (XoTestsBookAuthorUpdateParams) GetPseudonym

func (p XoTestsBookAuthorUpdateParams) GetPseudonym() *string

type XoTestsBookAuthorsSurrogateKey

type XoTestsBookAuthorsSurrogateKey struct {
	BookAuthorsSurrogateKeyID XoTestsBookAuthorsSurrogateKeyID `json:"bookAuthorsSurrogateKeyID" db:"book_authors_surrogate_key_id" required:"true" nullable:"false"` // book_authors_surrogate_key_id
	BookID                    XoTestsBookID                    `json:"bookID" db:"book_id" required:"true" nullable:"false"`                                          // book_id
	AuthorID                  XoTestsUserID                    `json:"authorID" db:"author_id" required:"true" nullable:"false"`                                      // author_id
	Pseudonym                 *string                          `json:"pseudonym" db:"pseudonym"`                                                                      // pseudonym

	BooksJoin   *[]XoTestsBookAuthorsSurrogateKeyM2MBookBASK   `json:"-" db:"book_authors_surrogate_key_books"`   // M2M book_authors_surrogate_key
	AuthorsJoin *[]XoTestsBookAuthorsSurrogateKeyM2MAuthorBASK `json:"-" db:"book_authors_surrogate_key_authors"` // M2M book_authors_surrogate_key
}

XoTestsBookAuthorsSurrogateKey represents a row from 'xo_tests.book_authors_surrogate_key'.

func CreateXoTestsBookAuthorsSurrogateKey

func CreateXoTestsBookAuthorsSurrogateKey(ctx context.Context, db DB, params *XoTestsBookAuthorsSurrogateKeyCreateParams) (*XoTestsBookAuthorsSurrogateKey, error)

CreateXoTestsBookAuthorsSurrogateKey creates a new XoTestsBookAuthorsSurrogateKey in the database with the given params.

func XoTestsBookAuthorsSurrogateKeyByBookAuthorsSurrogateKeyID

func XoTestsBookAuthorsSurrogateKeyByBookAuthorsSurrogateKeyID(ctx context.Context, db DB, bookAuthorsSurrogateKeyID XoTestsBookAuthorsSurrogateKeyID, opts ...XoTestsBookAuthorsSurrogateKeySelectConfigOption) (*XoTestsBookAuthorsSurrogateKey, error)

XoTestsBookAuthorsSurrogateKeyByBookAuthorsSurrogateKeyID retrieves a row from 'xo_tests.book_authors_surrogate_key' as a XoTestsBookAuthorsSurrogateKey.

Generated from index 'book_authors_surrogate_key_pkey'.

func XoTestsBookAuthorsSurrogateKeyByBookIDAuthorID

func XoTestsBookAuthorsSurrogateKeyByBookIDAuthorID(ctx context.Context, db DB, bookID XoTestsBookID, authorID XoTestsUserID, opts ...XoTestsBookAuthorsSurrogateKeySelectConfigOption) (*XoTestsBookAuthorsSurrogateKey, error)

XoTestsBookAuthorsSurrogateKeyByBookIDAuthorID retrieves a row from 'xo_tests.book_authors_surrogate_key' as a XoTestsBookAuthorsSurrogateKey.

Generated from index 'book_authors_surrogate_key_book_id_author_id_key'.

func XoTestsBookAuthorsSurrogateKeyPaginated

func XoTestsBookAuthorsSurrogateKeyPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsBookAuthorsSurrogateKeySelectConfigOption) ([]XoTestsBookAuthorsSurrogateKey, error)

XoTestsBookAuthorsSurrogateKeyPaginated returns a cursor-paginated list of XoTestsBookAuthorsSurrogateKey. At least one cursor is required.

func XoTestsBookAuthorsSurrogateKeysByAuthorID

func XoTestsBookAuthorsSurrogateKeysByAuthorID(ctx context.Context, db DB, authorID XoTestsUserID, opts ...XoTestsBookAuthorsSurrogateKeySelectConfigOption) ([]XoTestsBookAuthorsSurrogateKey, error)

XoTestsBookAuthorsSurrogateKeysByAuthorID retrieves a row from 'xo_tests.book_authors_surrogate_key' as a XoTestsBookAuthorsSurrogateKey.

Generated from index 'book_authors_surrogate_key_book_id_author_id_key'.

func XoTestsBookAuthorsSurrogateKeysByBookID

func XoTestsBookAuthorsSurrogateKeysByBookID(ctx context.Context, db DB, bookID XoTestsBookID, opts ...XoTestsBookAuthorsSurrogateKeySelectConfigOption) ([]XoTestsBookAuthorsSurrogateKey, error)

XoTestsBookAuthorsSurrogateKeysByBookID retrieves a row from 'xo_tests.book_authors_surrogate_key' as a XoTestsBookAuthorsSurrogateKey.

Generated from index 'book_authors_surrogate_key_book_id_author_id_key'.

func (*XoTestsBookAuthorsSurrogateKey) Delete

func (xtbask *XoTestsBookAuthorsSurrogateKey) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsBookAuthorsSurrogateKey from the database.

func (*XoTestsBookAuthorsSurrogateKey) FKBook_BookID

func (xtbask *XoTestsBookAuthorsSurrogateKey) FKBook_BookID(ctx context.Context, db DB) (*XoTestsBook, error)

FKBook_BookID returns the Book associated with the XoTestsBookAuthorsSurrogateKey's (BookID).

Generated from foreign key 'book_authors_surrogate_key_book_id_fkey'.

func (*XoTestsBookAuthorsSurrogateKey) FKUser_AuthorID

func (xtbask *XoTestsBookAuthorsSurrogateKey) FKUser_AuthorID(ctx context.Context, db DB) (*XoTestsUser, error)

FKUser_AuthorID returns the User associated with the XoTestsBookAuthorsSurrogateKey's (AuthorID).

Generated from foreign key 'book_authors_surrogate_key_author_id_fkey'.

func (*XoTestsBookAuthorsSurrogateKey) Insert

Insert inserts the XoTestsBookAuthorsSurrogateKey to the database.

func (*XoTestsBookAuthorsSurrogateKey) SetUpdateParams

SetUpdateParams updates xo_tests.book_authors_surrogate_key struct fields with the specified params.

func (*XoTestsBookAuthorsSurrogateKey) Update

Update updates a XoTestsBookAuthorsSurrogateKey in the database.

func (*XoTestsBookAuthorsSurrogateKey) Upsert

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

type XoTestsBookAuthorsSurrogateKeyCreateParams

type XoTestsBookAuthorsSurrogateKeyCreateParams struct {
	AuthorID  XoTestsUserID `json:"authorID" required:"true" nullable:"false"` // author_id
	BookID    XoTestsBookID `json:"bookID" required:"true" nullable:"false"`   // book_id
	Pseudonym *string       `json:"pseudonym"`                                 // pseudonym
}

XoTestsBookAuthorsSurrogateKeyCreateParams represents insert params for 'xo_tests.book_authors_surrogate_key'.

func (XoTestsBookAuthorsSurrogateKeyCreateParams) GetAuthorID

func (XoTestsBookAuthorsSurrogateKeyCreateParams) GetBookID

func (XoTestsBookAuthorsSurrogateKeyCreateParams) GetPseudonym

type XoTestsBookAuthorsSurrogateKeyID

type XoTestsBookAuthorsSurrogateKeyID int

type XoTestsBookAuthorsSurrogateKeyJoins

type XoTestsBookAuthorsSurrogateKeyJoins struct {
	Books   bool `json:"books" required:"true" nullable:"false"`   // M2M book_authors_surrogate_key
	Authors bool `json:"authors" required:"true" nullable:"false"` // M2M book_authors_surrogate_key
}

type XoTestsBookAuthorsSurrogateKeyM2MAuthorBASK

type XoTestsBookAuthorsSurrogateKeyM2MAuthorBASK struct {
	User      XoTestsUser `json:"user" db:"users" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookAuthorsSurrogateKeyM2MAuthorBASK represents a M2M join against "xo_tests.book_authors_surrogate_key"

type XoTestsBookAuthorsSurrogateKeyM2MBookBASK

type XoTestsBookAuthorsSurrogateKeyM2MBookBASK struct {
	Book      XoTestsBook `json:"book" db:"books" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookAuthorsSurrogateKeyM2MBookBASK represents a M2M join against "xo_tests.book_authors_surrogate_key"

type XoTestsBookAuthorsSurrogateKeyParams

type XoTestsBookAuthorsSurrogateKeyParams interface {
	GetAuthorID() *XoTestsUserID
	GetBookID() *XoTestsBookID
	GetPseudonym() *string
}

XoTestsBookAuthorsSurrogateKeyParams represents common params for both insert and update of 'xo_tests.book_authors_surrogate_key'.

type XoTestsBookAuthorsSurrogateKeySelectConfig

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

type XoTestsBookAuthorsSurrogateKeySelectConfigOption

type XoTestsBookAuthorsSurrogateKeySelectConfigOption func(*XoTestsBookAuthorsSurrogateKeySelectConfig)

func WithXoTestsBookAuthorsSurrogateKeyFilters

func WithXoTestsBookAuthorsSurrogateKeyFilters(filters map[string][]any) XoTestsBookAuthorsSurrogateKeySelectConfigOption

WithXoTestsBookAuthorsSurrogateKeyFilters adds the given WHERE clause conditions, 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 WithXoTestsBookAuthorsSurrogateKeyHavingClause

func WithXoTestsBookAuthorsSurrogateKeyHavingClause(conditions map[string][]any) XoTestsBookAuthorsSurrogateKeySelectConfigOption

WithXoTestsBookAuthorsSurrogateKeyHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsBookAuthorsSurrogateKeyJoin

WithXoTestsBookAuthorsSurrogateKeyJoin joins with the given tables.

func WithXoTestsBookAuthorsSurrogateKeyLimit

func WithXoTestsBookAuthorsSurrogateKeyLimit(limit int) XoTestsBookAuthorsSurrogateKeySelectConfigOption

WithXoTestsBookAuthorsSurrogateKeyLimit limits row selection.

func WithXoTestsBookAuthorsSurrogateKeyOrderBy

func WithXoTestsBookAuthorsSurrogateKeyOrderBy(rows map[string]*Direction) XoTestsBookAuthorsSurrogateKeySelectConfigOption

WithXoTestsBookAuthorsSurrogateKeyOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsBookAuthorsSurrogateKeyUpdateParams

type XoTestsBookAuthorsSurrogateKeyUpdateParams struct {
	AuthorID  *XoTestsUserID `json:"authorID" nullable:"false"` // author_id
	BookID    *XoTestsBookID `json:"bookID" nullable:"false"`   // book_id
	Pseudonym **string       `json:"pseudonym"`                 // pseudonym
}

XoTestsBookAuthorsSurrogateKeyUpdateParams represents update params for 'xo_tests.book_authors_surrogate_key'.

func (XoTestsBookAuthorsSurrogateKeyUpdateParams) GetAuthorID

func (XoTestsBookAuthorsSurrogateKeyUpdateParams) GetBookID

func (XoTestsBookAuthorsSurrogateKeyUpdateParams) GetPseudonym

type XoTestsBookCreateParams

type XoTestsBookCreateParams struct {
	Name string `json:"name" required:"true" nullable:"false"` // name
}

XoTestsBookCreateParams represents insert params for 'xo_tests.books'.

func (XoTestsBookCreateParams) GetName

func (p XoTestsBookCreateParams) GetName() *string

type XoTestsBookID

type XoTestsBookID int

type XoTestsBookJoins

type XoTestsBookJoins struct {
	Authors     bool `json:"authors" required:"true" nullable:"false"`     // M2M book_authors
	AuthorsBASK bool `json:"authorsBASK" required:"true" nullable:"false"` // M2M book_authors_surrogate_key
	BookReviews bool `json:"bookReviews" required:"true" nullable:"false"` // M2O book_reviews
	Sellers     bool `json:"sellers" required:"true" nullable:"false"`     // M2M book_sellers
}

type XoTestsBookM2MAuthorBA

type XoTestsBookM2MAuthorBA struct {
	User      XoTestsUser `json:"user" db:"users" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookM2MAuthorBA represents a M2M join against "xo_tests.book_authors"

type XoTestsBookM2MAuthorBASK

type XoTestsBookM2MAuthorBASK struct {
	User      XoTestsUser `json:"user" db:"users" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsBookM2MAuthorBASK represents a M2M join against "xo_tests.book_authors_surrogate_key"

type XoTestsBookParams

type XoTestsBookParams interface {
	GetName() *string
}

XoTestsBookParams represents common params for both insert and update of 'xo_tests.books'.

type XoTestsBookReview

type XoTestsBookReview struct {
	BookReviewID XoTestsBookReviewID `json:"bookReviewID" db:"book_review_id" required:"true" nullable:"false"` // book_review_id
	BookID       XoTestsBookID       `json:"bookID" db:"book_id" required:"true" nullable:"false"`              // book_id
	Reviewer     XoTestsUserID       `json:"reviewer" db:"reviewer" required:"true" nullable:"false"`           // reviewer

	BookJoin *XoTestsBook `json:"-" db:"book_book_id"`  // O2O books (generated from M2O)
	UserJoin *XoTestsUser `json:"-" db:"user_reviewer"` // O2O users (generated from M2O)
}

XoTestsBookReview represents a row from 'xo_tests.book_reviews'.

func CreateXoTestsBookReview

func CreateXoTestsBookReview(ctx context.Context, db DB, params *XoTestsBookReviewCreateParams) (*XoTestsBookReview, error)

CreateXoTestsBookReview creates a new XoTestsBookReview in the database with the given params.

func XoTestsBookReviewByBookReviewID

func XoTestsBookReviewByBookReviewID(ctx context.Context, db DB, bookReviewID XoTestsBookReviewID, opts ...XoTestsBookReviewSelectConfigOption) (*XoTestsBookReview, error)

XoTestsBookReviewByBookReviewID retrieves a row from 'xo_tests.book_reviews' as a XoTestsBookReview.

Generated from index 'book_reviews_pkey'.

func XoTestsBookReviewByReviewerBookID

func XoTestsBookReviewByReviewerBookID(ctx context.Context, db DB, reviewer XoTestsUserID, bookID XoTestsBookID, opts ...XoTestsBookReviewSelectConfigOption) (*XoTestsBookReview, error)

XoTestsBookReviewByReviewerBookID retrieves a row from 'xo_tests.book_reviews' as a XoTestsBookReview.

Generated from index 'book_reviews_reviewer_book_id_key'.

func XoTestsBookReviewPaginated

func XoTestsBookReviewPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsBookReviewSelectConfigOption) ([]XoTestsBookReview, error)

XoTestsBookReviewPaginated returns a cursor-paginated list of XoTestsBookReview. At least one cursor is required.

func XoTestsBookReviewsByBookID

func XoTestsBookReviewsByBookID(ctx context.Context, db DB, bookID XoTestsBookID, opts ...XoTestsBookReviewSelectConfigOption) ([]XoTestsBookReview, error)

XoTestsBookReviewsByBookID retrieves a row from 'xo_tests.book_reviews' as a XoTestsBookReview.

Generated from index 'book_reviews_reviewer_book_id_key'.

func XoTestsBookReviewsByReviewer

func XoTestsBookReviewsByReviewer(ctx context.Context, db DB, reviewer XoTestsUserID, opts ...XoTestsBookReviewSelectConfigOption) ([]XoTestsBookReview, error)

XoTestsBookReviewsByReviewer retrieves a row from 'xo_tests.book_reviews' as a XoTestsBookReview.

Generated from index 'book_reviews_reviewer_book_id_key'.

func (*XoTestsBookReview) Delete

func (xtbr *XoTestsBookReview) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsBookReview from the database.

func (*XoTestsBookReview) FKBook_BookID

func (xtbr *XoTestsBookReview) FKBook_BookID(ctx context.Context, db DB) (*XoTestsBook, error)

FKBook_BookID returns the Book associated with the XoTestsBookReview's (BookID).

Generated from foreign key 'book_reviews_book_id_fkey'.

func (*XoTestsBookReview) FKUser_Reviewer

func (xtbr *XoTestsBookReview) FKUser_Reviewer(ctx context.Context, db DB) (*XoTestsUser, error)

FKUser_Reviewer returns the User associated with the XoTestsBookReview's (Reviewer).

Generated from foreign key 'book_reviews_reviewer_fkey'.

func (*XoTestsBookReview) Insert

func (xtbr *XoTestsBookReview) Insert(ctx context.Context, db DB) (*XoTestsBookReview, error)

Insert inserts the XoTestsBookReview to the database.

func (*XoTestsBookReview) SetUpdateParams

func (xtbr *XoTestsBookReview) SetUpdateParams(params *XoTestsBookReviewUpdateParams)

SetUpdateParams updates xo_tests.book_reviews struct fields with the specified params.

func (*XoTestsBookReview) Update

func (xtbr *XoTestsBookReview) Update(ctx context.Context, db DB) (*XoTestsBookReview, error)

Update updates a XoTestsBookReview in the database.

func (*XoTestsBookReview) Upsert

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

type XoTestsBookReviewCreateParams

type XoTestsBookReviewCreateParams struct {
	BookID   XoTestsBookID `json:"bookID" required:"true" nullable:"false"`   // book_id
	Reviewer XoTestsUserID `json:"reviewer" required:"true" nullable:"false"` // reviewer
}

XoTestsBookReviewCreateParams represents insert params for 'xo_tests.book_reviews'.

func (XoTestsBookReviewCreateParams) GetBookID

func (XoTestsBookReviewCreateParams) GetReviewer

type XoTestsBookReviewID

type XoTestsBookReviewID int

type XoTestsBookReviewJoins

type XoTestsBookReviewJoins struct {
	Book bool `json:"book" required:"true" nullable:"false"` // O2O books
	User bool `json:"user" required:"true" nullable:"false"` // O2O users
}

type XoTestsBookReviewParams

type XoTestsBookReviewParams interface {
	GetBookID() *XoTestsBookID
	GetReviewer() *XoTestsUserID
}

XoTestsBookReviewParams represents common params for both insert and update of 'xo_tests.book_reviews'.

type XoTestsBookReviewSelectConfig

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

type XoTestsBookReviewSelectConfigOption

type XoTestsBookReviewSelectConfigOption func(*XoTestsBookReviewSelectConfig)

func WithXoTestsBookReviewFilters

func WithXoTestsBookReviewFilters(filters map[string][]any) XoTestsBookReviewSelectConfigOption

WithXoTestsBookReviewFilters adds the given WHERE clause conditions, 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 WithXoTestsBookReviewHavingClause

func WithXoTestsBookReviewHavingClause(conditions map[string][]any) XoTestsBookReviewSelectConfigOption

WithXoTestsBookReviewHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsBookReviewJoin

func WithXoTestsBookReviewJoin(joins XoTestsBookReviewJoins) XoTestsBookReviewSelectConfigOption

WithXoTestsBookReviewJoin joins with the given tables.

func WithXoTestsBookReviewLimit

func WithXoTestsBookReviewLimit(limit int) XoTestsBookReviewSelectConfigOption

WithXoTestsBookReviewLimit limits row selection.

func WithXoTestsBookReviewOrderBy

func WithXoTestsBookReviewOrderBy(rows map[string]*Direction) XoTestsBookReviewSelectConfigOption

WithXoTestsBookReviewOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsBookReviewUpdateParams

type XoTestsBookReviewUpdateParams struct {
	BookID   *XoTestsBookID `json:"bookID" nullable:"false"`   // book_id
	Reviewer *XoTestsUserID `json:"reviewer" nullable:"false"` // reviewer
}

XoTestsBookReviewUpdateParams represents update params for 'xo_tests.book_reviews'.

func (XoTestsBookReviewUpdateParams) GetBookID

func (XoTestsBookReviewUpdateParams) GetReviewer

type XoTestsBookSelectConfig

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

type XoTestsBookSelectConfigOption

type XoTestsBookSelectConfigOption func(*XoTestsBookSelectConfig)

func WithXoTestsBookFilters

func WithXoTestsBookFilters(filters map[string][]any) XoTestsBookSelectConfigOption

WithXoTestsBookFilters adds the given WHERE clause conditions, 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 WithXoTestsBookHavingClause

func WithXoTestsBookHavingClause(conditions map[string][]any) XoTestsBookSelectConfigOption

WithXoTestsBookHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsBookJoin

func WithXoTestsBookJoin(joins XoTestsBookJoins) XoTestsBookSelectConfigOption

WithXoTestsBookJoin joins with the given tables.

func WithXoTestsBookLimit

func WithXoTestsBookLimit(limit int) XoTestsBookSelectConfigOption

WithXoTestsBookLimit limits row selection.

func WithXoTestsBookOrderBy

func WithXoTestsBookOrderBy(rows map[string]*Direction) XoTestsBookSelectConfigOption

WithXoTestsBookOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsBookSeller

type XoTestsBookSeller struct {
	BookID XoTestsBookID `json:"bookID" db:"book_id" required:"true" nullable:"false"` // book_id
	Seller XoTestsUserID `json:"seller" db:"seller" required:"true" nullable:"false"`  // seller

	SellersJoin *[]XoTestsUser `json:"-" db:"book_sellers_sellers"` // M2M book_sellers
	BooksJoin   *[]XoTestsBook `json:"-" db:"book_sellers_books"`   // M2M book_sellers
}

XoTestsBookSeller represents a row from 'xo_tests.book_sellers'.

func CreateXoTestsBookSeller

func CreateXoTestsBookSeller(ctx context.Context, db DB, params *XoTestsBookSellerCreateParams) (*XoTestsBookSeller, error)

CreateXoTestsBookSeller creates a new XoTestsBookSeller in the database with the given params.

func XoTestsBookSellerPaginated

func XoTestsBookSellerPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsBookSellerSelectConfigOption) ([]XoTestsBookSeller, error)

XoTestsBookSellerPaginated returns a cursor-paginated list of XoTestsBookSeller. At least one cursor is required.

func XoTestsBookSellersByBookID

func XoTestsBookSellersByBookID(ctx context.Context, db DB, bookID XoTestsBookID, opts ...XoTestsBookSellerSelectConfigOption) ([]XoTestsBookSeller, error)

XoTestsBookSellersByBookID retrieves a row from 'xo_tests.book_sellers' as a XoTestsBookSeller.

Generated from index 'book_sellers_pkey'.

func XoTestsBookSellersByBookIDSeller

func XoTestsBookSellersByBookIDSeller(ctx context.Context, db DB, bookID XoTestsBookID, seller XoTestsUserID, opts ...XoTestsBookSellerSelectConfigOption) ([]XoTestsBookSeller, error)

XoTestsBookSellersByBookIDSeller retrieves a row from 'xo_tests.book_sellers' as a XoTestsBookSeller.

Generated from index 'book_sellers_book_id_seller_idx'.

func XoTestsBookSellersBySeller

func XoTestsBookSellersBySeller(ctx context.Context, db DB, seller XoTestsUserID, opts ...XoTestsBookSellerSelectConfigOption) ([]XoTestsBookSeller, error)

XoTestsBookSellersBySeller retrieves a row from 'xo_tests.book_sellers' as a XoTestsBookSeller.

Generated from index 'book_sellers_pkey'.

func XoTestsBookSellersBySellerBookID

func XoTestsBookSellersBySellerBookID(ctx context.Context, db DB, seller XoTestsUserID, bookID XoTestsBookID, opts ...XoTestsBookSellerSelectConfigOption) ([]XoTestsBookSeller, error)

XoTestsBookSellersBySellerBookID retrieves a row from 'xo_tests.book_sellers' as a XoTestsBookSeller.

Generated from index 'book_sellers_seller_book_id_idx'.

func (*XoTestsBookSeller) Delete

func (xtbs *XoTestsBookSeller) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsBookSeller from the database.

func (*XoTestsBookSeller) FKBook_BookID

func (xtbs *XoTestsBookSeller) FKBook_BookID(ctx context.Context, db DB) (*XoTestsBook, error)

FKBook_BookID returns the Book associated with the XoTestsBookSeller's (BookID).

Generated from foreign key 'book_sellers_book_id_fkey'.

func (*XoTestsBookSeller) FKUser_Seller

func (xtbs *XoTestsBookSeller) FKUser_Seller(ctx context.Context, db DB) (*XoTestsUser, error)

FKUser_Seller returns the User associated with the XoTestsBookSeller's (Seller).

Generated from foreign key 'book_sellers_seller_fkey'.

func (*XoTestsBookSeller) Insert

func (xtbs *XoTestsBookSeller) Insert(ctx context.Context, db DB) (*XoTestsBookSeller, error)

Insert inserts the XoTestsBookSeller to the database.

func (*XoTestsBookSeller) SetUpdateParams

func (xtbs *XoTestsBookSeller) SetUpdateParams(params *XoTestsBookSellerUpdateParams)

SetUpdateParams updates xo_tests.book_sellers struct fields with the specified params.

type XoTestsBookSellerCreateParams

type XoTestsBookSellerCreateParams struct {
	BookID XoTestsBookID `json:"bookID" required:"true" nullable:"false"` // book_id
	Seller XoTestsUserID `json:"seller" required:"true" nullable:"false"` // seller
}

XoTestsBookSellerCreateParams represents insert params for 'xo_tests.book_sellers'.

func (XoTestsBookSellerCreateParams) GetBookID

func (XoTestsBookSellerCreateParams) GetSeller

type XoTestsBookSellerJoins

type XoTestsBookSellerJoins struct {
	Sellers bool `json:"sellers" required:"true" nullable:"false"` // M2M book_sellers
	Books   bool `json:"books" required:"true" nullable:"false"`   // M2M book_sellers
}

type XoTestsBookSellerParams

type XoTestsBookSellerParams interface {
	GetBookID() *XoTestsBookID
	GetSeller() *XoTestsUserID
}

XoTestsBookSellerParams represents common params for both insert and update of 'xo_tests.book_sellers'.

type XoTestsBookSellerSelectConfig

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

type XoTestsBookSellerSelectConfigOption

type XoTestsBookSellerSelectConfigOption func(*XoTestsBookSellerSelectConfig)

func WithXoTestsBookSellerFilters

func WithXoTestsBookSellerFilters(filters map[string][]any) XoTestsBookSellerSelectConfigOption

WithXoTestsBookSellerFilters adds the given WHERE clause conditions, 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 WithXoTestsBookSellerHavingClause

func WithXoTestsBookSellerHavingClause(conditions map[string][]any) XoTestsBookSellerSelectConfigOption

WithXoTestsBookSellerHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsBookSellerJoin

func WithXoTestsBookSellerJoin(joins XoTestsBookSellerJoins) XoTestsBookSellerSelectConfigOption

WithXoTestsBookSellerJoin joins with the given tables.

func WithXoTestsBookSellerLimit

func WithXoTestsBookSellerLimit(limit int) XoTestsBookSellerSelectConfigOption

WithXoTestsBookSellerLimit limits row selection.

func WithXoTestsBookSellerOrderBy

func WithXoTestsBookSellerOrderBy(rows map[string]*Direction) XoTestsBookSellerSelectConfigOption

WithXoTestsBookSellerOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsBookSellerUpdateParams

type XoTestsBookSellerUpdateParams struct {
	BookID *XoTestsBookID `json:"bookID" nullable:"false"` // book_id
	Seller *XoTestsUserID `json:"seller" nullable:"false"` // seller
}

XoTestsBookSellerUpdateParams represents update params for 'xo_tests.book_sellers'.

func (XoTestsBookSellerUpdateParams) GetBookID

func (XoTestsBookSellerUpdateParams) GetSeller

type XoTestsBookUpdateParams

type XoTestsBookUpdateParams struct {
	Name *string `json:"name" nullable:"false"` // name
}

XoTestsBookUpdateParams represents update params for 'xo_tests.books'.

func (XoTestsBookUpdateParams) GetName

func (p XoTestsBookUpdateParams) GetName() *string

type XoTestsCacheDemoWorkItem

type XoTestsCacheDemoWorkItem struct {
	WorkItemID XoTestsWorkItemID `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"` // work_item_id
	Title      *string           `json:"title" db:"title"`                                              // title
	TeamID     XoTestsTeamID     `json:"teamID" db:"team_id" required:"true" nullable:"false"`          // team_id

	TeamJoin             *XoTestsTeam                              `json:"-" db:"team_team_id"`                 // O2O teams (inferred)
	TimeEntriesJoin      *[]XoTestsTimeEntry                       `json:"-" db:"time_entries"`                 // M2O cache__demo_work_items
	AssigneesJoin        *[]XoTestsCacheDemoWorkItemM2MAssigneeWIA `json:"-" db:"work_item_assignee_assignees"` // M2M work_item_assignee
	WorkItemCommentsJoin *[]XoTestsWorkItemComment                 `json:"-" db:"work_item_comments"`           // M2O cache__demo_work_items
}

XoTestsCacheDemoWorkItem represents a row from 'xo_tests.cache__demo_work_items'.

func CreateXoTestsCacheDemoWorkItem

func CreateXoTestsCacheDemoWorkItem(ctx context.Context, db DB, params *XoTestsCacheDemoWorkItemCreateParams) (*XoTestsCacheDemoWorkItem, error)

CreateXoTestsCacheDemoWorkItem creates a new XoTestsCacheDemoWorkItem in the database with the given params.

func XoTestsCacheDemoWorkItemByWorkItemID

func XoTestsCacheDemoWorkItemByWorkItemID(ctx context.Context, db DB, workItemID int, opts ...XoTestsCacheDemoWorkItemSelectConfigOption) (*XoTestsCacheDemoWorkItem, error)

XoTestsCacheDemoWorkItemByWorkItemID retrieves a row from 'xo_tests.cache__demo_work_items' as a XoTestsCacheDemoWorkItem.

Generated from index 'cache__demo_work_items_pkey'.

func XoTestsCacheDemoWorkItemPaginated

func XoTestsCacheDemoWorkItemPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsCacheDemoWorkItemSelectConfigOption) ([]XoTestsCacheDemoWorkItem, error)

XoTestsCacheDemoWorkItemPaginated returns a cursor-paginated list of XoTestsCacheDemoWorkItem. At least one cursor is required.

func (*XoTestsCacheDemoWorkItem) Delete

func (xtcdwi *XoTestsCacheDemoWorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsCacheDemoWorkItem from the database.

func (*XoTestsCacheDemoWorkItem) FKTeam_TeamID

func (xtcdwi *XoTestsCacheDemoWorkItem) FKTeam_TeamID(ctx context.Context, db DB) (*XoTestsTeam, error)

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

Generated from foreign key 'cache__demo_work_items_team_id_fkey'.

func (*XoTestsCacheDemoWorkItem) FKWorkItem_WorkItemID

func (xtcdwi *XoTestsCacheDemoWorkItem) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*XoTestsWorkItem, error)

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

Generated from foreign key 'cache__demo_work_items_work_item_id_fkey'.

func (*XoTestsCacheDemoWorkItem) Insert

Insert inserts the XoTestsCacheDemoWorkItem to the database.

func (*XoTestsCacheDemoWorkItem) SetUpdateParams

func (xtcdwi *XoTestsCacheDemoWorkItem) SetUpdateParams(params *XoTestsCacheDemoWorkItemUpdateParams)

SetUpdateParams updates xo_tests.cache__demo_work_items struct fields with the specified params.

func (*XoTestsCacheDemoWorkItem) Update

Update updates a XoTestsCacheDemoWorkItem in the database.

func (*XoTestsCacheDemoWorkItem) Upsert

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

type XoTestsCacheDemoWorkItemCreateParams

type XoTestsCacheDemoWorkItemCreateParams struct {
	TeamID     XoTestsTeamID     `json:"teamID" required:"true" nullable:"false"` // team_id
	Title      *string           `json:"title"`                                   // title
	WorkItemID XoTestsWorkItemID `json:"-" required:"true" nullable:"false"`      // work_item_id
}

XoTestsCacheDemoWorkItemCreateParams represents insert params for 'xo_tests.cache__demo_work_items'.

func (XoTestsCacheDemoWorkItemCreateParams) GetTeamID

func (XoTestsCacheDemoWorkItemCreateParams) GetTitle

type XoTestsCacheDemoWorkItemJoins

type XoTestsCacheDemoWorkItemJoins struct {
	Team             bool `json:"team" required:"true" nullable:"false"`             // O2O teams
	TimeEntries      bool `json:"timeEntries" required:"true" nullable:"false"`      // M2O time_entries
	Assignees        bool `json:"assignees" required:"true" nullable:"false"`        // M2M work_item_assignee
	WorkItemComments bool `json:"workItemComments" required:"true" nullable:"false"` // M2O work_item_comments
}

type XoTestsCacheDemoWorkItemM2MAssigneeWIA

type XoTestsCacheDemoWorkItemM2MAssigneeWIA struct {
	User XoTestsUser          `json:"user" db:"users" required:"true"`
	Role *XoTestsWorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

XoTestsCacheDemoWorkItemM2MAssigneeWIA represents a M2M join against "xo_tests.work_item_assignee"

type XoTestsCacheDemoWorkItemParams

type XoTestsCacheDemoWorkItemParams interface {
	GetTeamID() *XoTestsTeamID
	GetTitle() *string
}

XoTestsCacheDemoWorkItemParams represents common params for both insert and update of 'xo_tests.cache__demo_work_items'.

type XoTestsCacheDemoWorkItemSelectConfig

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

type XoTestsCacheDemoWorkItemSelectConfigOption

type XoTestsCacheDemoWorkItemSelectConfigOption func(*XoTestsCacheDemoWorkItemSelectConfig)

func WithXoTestsCacheDemoWorkItemFilters

func WithXoTestsCacheDemoWorkItemFilters(filters map[string][]any) XoTestsCacheDemoWorkItemSelectConfigOption

WithXoTestsCacheDemoWorkItemFilters adds the given WHERE clause conditions, 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 WithXoTestsCacheDemoWorkItemHavingClause

func WithXoTestsCacheDemoWorkItemHavingClause(conditions map[string][]any) XoTestsCacheDemoWorkItemSelectConfigOption

WithXoTestsCacheDemoWorkItemHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsCacheDemoWorkItemJoin

func WithXoTestsCacheDemoWorkItemJoin(joins XoTestsCacheDemoWorkItemJoins) XoTestsCacheDemoWorkItemSelectConfigOption

WithXoTestsCacheDemoWorkItemJoin joins with the given tables.

func WithXoTestsCacheDemoWorkItemLimit

func WithXoTestsCacheDemoWorkItemLimit(limit int) XoTestsCacheDemoWorkItemSelectConfigOption

WithXoTestsCacheDemoWorkItemLimit limits row selection.

func WithXoTestsCacheDemoWorkItemOrderBy

func WithXoTestsCacheDemoWorkItemOrderBy(rows map[string]*Direction) XoTestsCacheDemoWorkItemSelectConfigOption

WithXoTestsCacheDemoWorkItemOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsCacheDemoWorkItemUpdateParams

type XoTestsCacheDemoWorkItemUpdateParams struct {
	TeamID *XoTestsTeamID `json:"teamID" nullable:"false"` // team_id
	Title  **string       `json:"title"`                   // title
}

XoTestsCacheDemoWorkItemUpdateParams represents update params for 'xo_tests.cache__demo_work_items'.

func (XoTestsCacheDemoWorkItemUpdateParams) GetTeamID

func (XoTestsCacheDemoWorkItemUpdateParams) GetTitle

type XoTestsCacheTableEntity

type XoTestsCacheTableEntity string

type XoTestsDemoWorkItem

type XoTestsDemoWorkItem struct {
	WorkItemID XoTestsWorkItemID `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"` // work_item_id
	Checked    bool              `json:"checked" db:"checked" required:"true" nullable:"false"`         // checked

	WorkItemJoin *XoTestsWorkItem `json:"-" db:"work_item_work_item_id"` // O2O work_items (inferred)
}

XoTestsDemoWorkItem represents a row from 'xo_tests.demo_work_items'.

func CreateXoTestsDemoWorkItem

func CreateXoTestsDemoWorkItem(ctx context.Context, db DB, params *XoTestsDemoWorkItemCreateParams) (*XoTestsDemoWorkItem, error)

CreateXoTestsDemoWorkItem creates a new XoTestsDemoWorkItem in the database with the given params.

func XoTestsDemoWorkItemByWorkItemID

func XoTestsDemoWorkItemByWorkItemID(ctx context.Context, db DB, workItemID XoTestsWorkItemID, opts ...XoTestsDemoWorkItemSelectConfigOption) (*XoTestsDemoWorkItem, error)

XoTestsDemoWorkItemByWorkItemID retrieves a row from 'xo_tests.demo_work_items' as a XoTestsDemoWorkItem.

Generated from index 'demo_work_items_pkey'.

func XoTestsDemoWorkItemPaginated

func XoTestsDemoWorkItemPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsDemoWorkItemSelectConfigOption) ([]XoTestsDemoWorkItem, error)

XoTestsDemoWorkItemPaginated returns a cursor-paginated list of XoTestsDemoWorkItem. At least one cursor is required.

func (*XoTestsDemoWorkItem) Delete

func (xtdwi *XoTestsDemoWorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsDemoWorkItem from the database.

func (*XoTestsDemoWorkItem) FKWorkItem_WorkItemID

func (xtdwi *XoTestsDemoWorkItem) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*XoTestsWorkItem, error)

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

Generated from foreign key 'demo_work_items_work_item_id_fkey'.

func (*XoTestsDemoWorkItem) Insert

func (xtdwi *XoTestsDemoWorkItem) Insert(ctx context.Context, db DB) (*XoTestsDemoWorkItem, error)

Insert inserts the XoTestsDemoWorkItem to the database.

func (*XoTestsDemoWorkItem) SetUpdateParams

func (xtdwi *XoTestsDemoWorkItem) SetUpdateParams(params *XoTestsDemoWorkItemUpdateParams)

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

func (*XoTestsDemoWorkItem) Update

func (xtdwi *XoTestsDemoWorkItem) Update(ctx context.Context, db DB) (*XoTestsDemoWorkItem, error)

Update updates a XoTestsDemoWorkItem in the database.

func (*XoTestsDemoWorkItem) Upsert

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

type XoTestsDemoWorkItemCreateParams

type XoTestsDemoWorkItemCreateParams struct {
	Checked    bool              `json:"checked" required:"true" nullable:"false"` // checked
	WorkItemID XoTestsWorkItemID `json:"-" required:"true" nullable:"false"`       // work_item_id
}

XoTestsDemoWorkItemCreateParams represents insert params for 'xo_tests.demo_work_items'.

func (XoTestsDemoWorkItemCreateParams) GetChecked

func (p XoTestsDemoWorkItemCreateParams) GetChecked() *bool

type XoTestsDemoWorkItemJoins

type XoTestsDemoWorkItemJoins struct {
	WorkItem bool `json:"workItem" required:"true" nullable:"false"` // O2O work_items
}

type XoTestsDemoWorkItemParams

type XoTestsDemoWorkItemParams interface {
	GetChecked() *bool
}

XoTestsDemoWorkItemParams represents common params for both insert and update of 'xo_tests.demo_work_items'.

type XoTestsDemoWorkItemSelectConfig

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

type XoTestsDemoWorkItemSelectConfigOption

type XoTestsDemoWorkItemSelectConfigOption func(*XoTestsDemoWorkItemSelectConfig)

func WithXoTestsDemoWorkItemFilters

func WithXoTestsDemoWorkItemFilters(filters map[string][]any) XoTestsDemoWorkItemSelectConfigOption

WithXoTestsDemoWorkItemFilters adds the given WHERE clause conditions, 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 WithXoTestsDemoWorkItemHavingClause

func WithXoTestsDemoWorkItemHavingClause(conditions map[string][]any) XoTestsDemoWorkItemSelectConfigOption

WithXoTestsDemoWorkItemHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsDemoWorkItemJoin

func WithXoTestsDemoWorkItemJoin(joins XoTestsDemoWorkItemJoins) XoTestsDemoWorkItemSelectConfigOption

WithXoTestsDemoWorkItemJoin joins with the given tables.

func WithXoTestsDemoWorkItemLimit

func WithXoTestsDemoWorkItemLimit(limit int) XoTestsDemoWorkItemSelectConfigOption

WithXoTestsDemoWorkItemLimit limits row selection.

func WithXoTestsDemoWorkItemOrderBy

func WithXoTestsDemoWorkItemOrderBy(rows map[string]*Direction) XoTestsDemoWorkItemSelectConfigOption

WithXoTestsDemoWorkItemOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsDemoWorkItemUpdateParams

type XoTestsDemoWorkItemUpdateParams struct {
	Checked *bool `json:"checked" nullable:"false"` // checked
}

XoTestsDemoWorkItemUpdateParams represents update params for 'xo_tests.demo_work_items'.

func (XoTestsDemoWorkItemUpdateParams) GetChecked

func (p XoTestsDemoWorkItemUpdateParams) GetChecked() *bool

type XoTestsDummyJoin

type XoTestsDummyJoin struct {
	DummyJoinID XoTestsDummyJoinID `json:"dummyJoinID" db:"dummy_join_id" required:"true" nullable:"false"` // dummy_join_id
	Name        *string            `json:"name" db:"name"`                                                  // name
}

XoTestsDummyJoin represents a row from 'xo_tests.dummy_join'.

func CreateXoTestsDummyJoin

func CreateXoTestsDummyJoin(ctx context.Context, db DB, params *XoTestsDummyJoinCreateParams) (*XoTestsDummyJoin, error)

CreateXoTestsDummyJoin creates a new XoTestsDummyJoin in the database with the given params.

func XoTestsDummyJoinByDummyJoinID

func XoTestsDummyJoinByDummyJoinID(ctx context.Context, db DB, dummyJoinID XoTestsDummyJoinID, opts ...XoTestsDummyJoinSelectConfigOption) (*XoTestsDummyJoin, error)

XoTestsDummyJoinByDummyJoinID retrieves a row from 'xo_tests.dummy_join' as a XoTestsDummyJoin.

Generated from index 'dummy_join_pkey'.

func XoTestsDummyJoinPaginated

func XoTestsDummyJoinPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsDummyJoinSelectConfigOption) ([]XoTestsDummyJoin, error)

XoTestsDummyJoinPaginated returns a cursor-paginated list of XoTestsDummyJoin. At least one cursor is required.

func (*XoTestsDummyJoin) Delete

func (xtdj *XoTestsDummyJoin) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsDummyJoin from the database.

func (*XoTestsDummyJoin) Insert

func (xtdj *XoTestsDummyJoin) Insert(ctx context.Context, db DB) (*XoTestsDummyJoin, error)

Insert inserts the XoTestsDummyJoin to the database.

func (*XoTestsDummyJoin) SetUpdateParams

func (xtdj *XoTestsDummyJoin) SetUpdateParams(params *XoTestsDummyJoinUpdateParams)

SetUpdateParams updates xo_tests.dummy_join struct fields with the specified params.

func (*XoTestsDummyJoin) Update

func (xtdj *XoTestsDummyJoin) Update(ctx context.Context, db DB) (*XoTestsDummyJoin, error)

Update updates a XoTestsDummyJoin in the database.

func (*XoTestsDummyJoin) Upsert

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

type XoTestsDummyJoinCreateParams

type XoTestsDummyJoinCreateParams struct {
	Name *string `json:"name"` // name
}

XoTestsDummyJoinCreateParams represents insert params for 'xo_tests.dummy_join'.

func (XoTestsDummyJoinCreateParams) GetName

func (p XoTestsDummyJoinCreateParams) GetName() *string

type XoTestsDummyJoinID

type XoTestsDummyJoinID int

type XoTestsDummyJoinJoins

type XoTestsDummyJoinJoins struct{}

type XoTestsDummyJoinParams

type XoTestsDummyJoinParams interface {
	GetName() *string
}

XoTestsDummyJoinParams represents common params for both insert and update of 'xo_tests.dummy_join'.

type XoTestsDummyJoinSelectConfig

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

type XoTestsDummyJoinSelectConfigOption

type XoTestsDummyJoinSelectConfigOption func(*XoTestsDummyJoinSelectConfig)

func WithXoTestsDummyJoinFilters

func WithXoTestsDummyJoinFilters(filters map[string][]any) XoTestsDummyJoinSelectConfigOption

WithXoTestsDummyJoinFilters adds the given WHERE clause conditions, 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 WithXoTestsDummyJoinHavingClause

func WithXoTestsDummyJoinHavingClause(conditions map[string][]any) XoTestsDummyJoinSelectConfigOption

WithXoTestsDummyJoinHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsDummyJoinJoin

func WithXoTestsDummyJoinJoin(joins XoTestsDummyJoinJoins) XoTestsDummyJoinSelectConfigOption

WithXoTestsDummyJoinJoin joins with the given tables.

func WithXoTestsDummyJoinLimit

func WithXoTestsDummyJoinLimit(limit int) XoTestsDummyJoinSelectConfigOption

WithXoTestsDummyJoinLimit limits row selection.

func WithXoTestsDummyJoinOrderBy

func WithXoTestsDummyJoinOrderBy(rows map[string]*Direction) XoTestsDummyJoinSelectConfigOption

WithXoTestsDummyJoinOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsDummyJoinUpdateParams

type XoTestsDummyJoinUpdateParams struct {
	Name **string `json:"name"` // name
}

XoTestsDummyJoinUpdateParams represents update params for 'xo_tests.dummy_join'.

func (XoTestsDummyJoinUpdateParams) GetName

func (p XoTestsDummyJoinUpdateParams) GetName() *string

type XoTestsNotification

type XoTestsNotification struct {
	NotificationID XoTestsNotificationID `json:"notificationID" db:"notification_id" required:"true" nullable:"false"` // notification_id
	Body           string                `json:"-" db:"body" nullable:"false" pattern:"^[A-Za-z0-9]*$"`                // body
	Sender         XoTestsUserID         `json:"sender" db:"sender" required:"true" nullable:"false"`                  // sender
	Receiver       *XoTestsUserID        `json:"receiver" db:"receiver"`                                               // receiver

	UserReceiverJoin *XoTestsUser `json:"-" db:"user_receiver"` // O2O users (generated from M2O)
	UserSenderJoin   *XoTestsUser `json:"-" db:"user_sender"`   // O2O users (generated from M2O)
}

XoTestsNotification represents a row from 'xo_tests.notifications'.

func CreateXoTestsNotification

func CreateXoTestsNotification(ctx context.Context, db DB, params *XoTestsNotificationCreateParams) (*XoTestsNotification, error)

CreateXoTestsNotification creates a new XoTestsNotification in the database with the given params.

func XoTestsNotificationByNotificationID

func XoTestsNotificationByNotificationID(ctx context.Context, db DB, notificationID XoTestsNotificationID, opts ...XoTestsNotificationSelectConfigOption) (*XoTestsNotification, error)

XoTestsNotificationByNotificationID retrieves a row from 'xo_tests.notifications' as a XoTestsNotification.

Generated from index 'notifications_pkey'.

func XoTestsNotificationPaginated

func XoTestsNotificationPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsNotificationSelectConfigOption) ([]XoTestsNotification, error)

XoTestsNotificationPaginated returns a cursor-paginated list of XoTestsNotification. At least one cursor is required.

func XoTestsNotificationsBySender

func XoTestsNotificationsBySender(ctx context.Context, db DB, sender XoTestsUserID, opts ...XoTestsNotificationSelectConfigOption) ([]XoTestsNotification, error)

XoTestsNotificationsBySender retrieves a row from 'xo_tests.notifications' as a XoTestsNotification.

Generated from index 'notifications_sender_idx'.

func (*XoTestsNotification) Delete

func (xtn *XoTestsNotification) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsNotification from the database.

func (*XoTestsNotification) FKUser_Receiver

func (xtn *XoTestsNotification) FKUser_Receiver(ctx context.Context, db DB) (*XoTestsUser, error)

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

Generated from foreign key 'notifications_receiver_fkey'.

func (*XoTestsNotification) FKUser_Sender

func (xtn *XoTestsNotification) FKUser_Sender(ctx context.Context, db DB) (*XoTestsUser, error)

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

Generated from foreign key 'notifications_sender_fkey'.

func (*XoTestsNotification) Insert

Insert inserts the XoTestsNotification to the database.

func (*XoTestsNotification) SetUpdateParams

func (xtn *XoTestsNotification) SetUpdateParams(params *XoTestsNotificationUpdateParams)

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

func (*XoTestsNotification) Update

Update updates a XoTestsNotification in the database.

func (*XoTestsNotification) Upsert

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

type XoTestsNotificationCreateParams

type XoTestsNotificationCreateParams struct {
	Body     string         `json:"-" nullable:"false" pattern:"^[A-Za-z0-9]*$"` // body
	Receiver *XoTestsUserID `json:"receiver"`                                    // receiver
	Sender   XoTestsUserID  `json:"sender" required:"true" nullable:"false"`     // sender
}

XoTestsNotificationCreateParams represents insert params for 'xo_tests.notifications'.

func (XoTestsNotificationCreateParams) GetBody

func (XoTestsNotificationCreateParams) GetReceiver

func (XoTestsNotificationCreateParams) GetSender

type XoTestsNotificationID

type XoTestsNotificationID int

type XoTestsNotificationJoins

type XoTestsNotificationJoins struct {
	UserReceiver bool `json:"userReceiver" required:"true" nullable:"false"` // O2O users
	UserSender   bool `json:"userSender" required:"true" nullable:"false"`   // O2O users
}

type XoTestsNotificationParams

type XoTestsNotificationParams interface {
	GetBody() *string
	GetReceiver() *XoTestsUserID
	GetSender() *XoTestsUserID
}

XoTestsNotificationParams represents common params for both insert and update of 'xo_tests.notifications'.

type XoTestsNotificationSelectConfig

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

type XoTestsNotificationSelectConfigOption

type XoTestsNotificationSelectConfigOption func(*XoTestsNotificationSelectConfig)

func WithXoTestsNotificationFilters

func WithXoTestsNotificationFilters(filters map[string][]any) XoTestsNotificationSelectConfigOption

WithXoTestsNotificationFilters adds the given WHERE clause conditions, 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 WithXoTestsNotificationHavingClause

func WithXoTestsNotificationHavingClause(conditions map[string][]any) XoTestsNotificationSelectConfigOption

WithXoTestsNotificationHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsNotificationJoin

func WithXoTestsNotificationJoin(joins XoTestsNotificationJoins) XoTestsNotificationSelectConfigOption

WithXoTestsNotificationJoin joins with the given tables.

func WithXoTestsNotificationLimit

func WithXoTestsNotificationLimit(limit int) XoTestsNotificationSelectConfigOption

WithXoTestsNotificationLimit limits row selection.

func WithXoTestsNotificationOrderBy

func WithXoTestsNotificationOrderBy(rows map[string]*Direction) XoTestsNotificationSelectConfigOption

WithXoTestsNotificationOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsNotificationUpdateParams

type XoTestsNotificationUpdateParams struct {
	Body     *string         `json:"-" nullable:"false" pattern:"^[A-Za-z0-9]*$"` // body
	Receiver **XoTestsUserID `json:"receiver"`                                    // receiver
	Sender   *XoTestsUserID  `json:"sender" nullable:"false"`                     // sender
}

XoTestsNotificationUpdateParams represents update params for 'xo_tests.notifications'.

func (XoTestsNotificationUpdateParams) GetBody

func (XoTestsNotificationUpdateParams) GetReceiver

func (XoTestsNotificationUpdateParams) GetSender

type XoTestsPagElement

type XoTestsPagElement struct {
	PaginatedElementID XoTestsPagElementID `json:"paginatedElementID" db:"paginated_element_id" required:"true" nullable:"false"` // paginated_element_id
	Name               string              `json:"name" db:"name" required:"true" nullable:"false"`                               // name
	CreatedAt          time.Time           `json:"createdAt" db:"created_at" required:"true" nullable:"false"`                    // created_at
	Dummy              *XoTestsDummyJoinID `json:"dummy" db:"dummy"`                                                              // dummy

	DummyJoinJoin *XoTestsDummyJoin `json:"-" db:"dummy_join_dummy"` // O2O dummy_join (inferred)
}

XoTestsPagElement represents a row from 'xo_tests.pag_element'.

func CreateXoTestsPagElement

func CreateXoTestsPagElement(ctx context.Context, db DB, params *XoTestsPagElementCreateParams) (*XoTestsPagElement, error)

CreateXoTestsPagElement creates a new XoTestsPagElement in the database with the given params.

func XoTestsPagElementByCreatedAt

func XoTestsPagElementByCreatedAt(ctx context.Context, db DB, createdAt time.Time, opts ...XoTestsPagElementSelectConfigOption) (*XoTestsPagElement, error)

XoTestsPagElementByCreatedAt retrieves a row from 'xo_tests.pag_element' as a XoTestsPagElement.

Generated from index 'pag_element_created_at_key'.

func XoTestsPagElementByPaginatedElementID

func XoTestsPagElementByPaginatedElementID(ctx context.Context, db DB, paginatedElementID XoTestsPagElementID, opts ...XoTestsPagElementSelectConfigOption) (*XoTestsPagElement, error)

XoTestsPagElementByPaginatedElementID retrieves a row from 'xo_tests.pag_element' as a XoTestsPagElement.

Generated from index 'pag_element_pkey'.

func XoTestsPagElementPaginated

func XoTestsPagElementPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsPagElementSelectConfigOption) ([]XoTestsPagElement, error)

XoTestsPagElementPaginated returns a cursor-paginated list of XoTestsPagElement. At least one cursor is required.

func (*XoTestsPagElement) Delete

func (xtpe *XoTestsPagElement) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsPagElement from the database.

func (*XoTestsPagElement) FKDummyJoin_Dummy

func (xtpe *XoTestsPagElement) FKDummyJoin_Dummy(ctx context.Context, db DB) (*XoTestsDummyJoin, error)

FKDummyJoin_Dummy returns the DummyJoin associated with the XoTestsPagElement's (Dummy).

Generated from foreign key 'pag_element_dummy_fkey'.

func (*XoTestsPagElement) Insert

func (xtpe *XoTestsPagElement) Insert(ctx context.Context, db DB) (*XoTestsPagElement, error)

Insert inserts the XoTestsPagElement to the database.

func (*XoTestsPagElement) SetUpdateParams

func (xtpe *XoTestsPagElement) SetUpdateParams(params *XoTestsPagElementUpdateParams)

SetUpdateParams updates xo_tests.pag_element struct fields with the specified params.

func (*XoTestsPagElement) Update

func (xtpe *XoTestsPagElement) Update(ctx context.Context, db DB) (*XoTestsPagElement, error)

Update updates a XoTestsPagElement in the database.

func (*XoTestsPagElement) Upsert

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

type XoTestsPagElementCreateParams

type XoTestsPagElementCreateParams struct {
	Dummy *XoTestsDummyJoinID `json:"dummy"`                                 // dummy
	Name  string              `json:"name" required:"true" nullable:"false"` // name
}

XoTestsPagElementCreateParams represents insert params for 'xo_tests.pag_element'.

func (XoTestsPagElementCreateParams) GetDummy

func (XoTestsPagElementCreateParams) GetName

type XoTestsPagElementID

type XoTestsPagElementID struct {
	uuid.UUID
}

func NewXoTestsPagElementID

func NewXoTestsPagElementID(id uuid.UUID) XoTestsPagElementID

type XoTestsPagElementJoins

type XoTestsPagElementJoins struct {
	DummyJoin bool `json:"dummyJoin" required:"true" nullable:"false"` // O2O dummy_join
}

type XoTestsPagElementParams

type XoTestsPagElementParams interface {
	GetDummy() *XoTestsDummyJoinID
	GetName() *string
}

XoTestsPagElementParams represents common params for both insert and update of 'xo_tests.pag_element'.

type XoTestsPagElementSelectConfig

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

type XoTestsPagElementSelectConfigOption

type XoTestsPagElementSelectConfigOption func(*XoTestsPagElementSelectConfig)

func WithXoTestsPagElementFilters

func WithXoTestsPagElementFilters(filters map[string][]any) XoTestsPagElementSelectConfigOption

WithXoTestsPagElementFilters adds the given WHERE clause conditions, 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 WithXoTestsPagElementHavingClause

func WithXoTestsPagElementHavingClause(conditions map[string][]any) XoTestsPagElementSelectConfigOption

WithXoTestsPagElementHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsPagElementJoin

func WithXoTestsPagElementJoin(joins XoTestsPagElementJoins) XoTestsPagElementSelectConfigOption

WithXoTestsPagElementJoin joins with the given tables.

func WithXoTestsPagElementLimit

func WithXoTestsPagElementLimit(limit int) XoTestsPagElementSelectConfigOption

WithXoTestsPagElementLimit limits row selection.

func WithXoTestsPagElementOrderBy

func WithXoTestsPagElementOrderBy(rows map[string]*Direction) XoTestsPagElementSelectConfigOption

WithXoTestsPagElementOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsPagElementUpdateParams

type XoTestsPagElementUpdateParams struct {
	Dummy **XoTestsDummyJoinID `json:"dummy"`                 // dummy
	Name  *string              `json:"name" nullable:"false"` // name
}

XoTestsPagElementUpdateParams represents update params for 'xo_tests.pag_element'.

func (XoTestsPagElementUpdateParams) GetDummy

func (XoTestsPagElementUpdateParams) GetName

type XoTestsTableEntity

type XoTestsTableEntity string
const (
	XoTestsTableEntityXoTestsBook                    XoTestsTableEntity = "xo_tests.books"
	XoTestsTableEntityXoTestsBookAuthor              XoTestsTableEntity = "xo_tests.book_authors"
	XoTestsTableEntityXoTestsBookAuthorsSurrogateKey XoTestsTableEntity = "xo_tests.book_authors_surrogate_key"
	XoTestsTableEntityXoTestsBookReview              XoTestsTableEntity = "xo_tests.book_reviews"
	XoTestsTableEntityXoTestsBookSeller              XoTestsTableEntity = "xo_tests.book_sellers"
	XoTestsTableEntityXoTestsCacheDemoWorkItem       XoTestsTableEntity = "xo_tests.cache__demo_work_items"
	XoTestsTableEntityXoTestsDemoWorkItem            XoTestsTableEntity = "xo_tests.demo_work_items"
	XoTestsTableEntityXoTestsDummyJoin               XoTestsTableEntity = "xo_tests.dummy_join"
	XoTestsTableEntityXoTestsNotification            XoTestsTableEntity = "xo_tests.notifications"
	XoTestsTableEntityXoTestsPagElement              XoTestsTableEntity = "xo_tests.pag_element"
	XoTestsTableEntityXoTestsTeam                    XoTestsTableEntity = "xo_tests.teams"
	XoTestsTableEntityXoTestsTimeEntry               XoTestsTableEntity = "xo_tests.time_entries"
	XoTestsTableEntityXoTestsUser                    XoTestsTableEntity = "xo_tests.users"
	XoTestsTableEntityXoTestsUserAPIKey              XoTestsTableEntity = "xo_tests.user_api_keys"
	XoTestsTableEntityXoTestsWorkItem                XoTestsTableEntity = "xo_tests.work_items"
	XoTestsTableEntityXoTestsWorkItemAssignee        XoTestsTableEntity = "xo_tests.work_item_assignee"
	XoTestsTableEntityXoTestsWorkItemComment         XoTestsTableEntity = "xo_tests.work_item_comments"
)

type XoTestsTeam

type XoTestsTeam struct {
	TeamID XoTestsTeamID `json:"teamID" db:"team_id" required:"true" nullable:"false"` // team_id
	Name   string        `json:"name" db:"name" required:"true" nullable:"false"`      // name
}

XoTestsTeam represents a row from 'xo_tests.teams'.

func CreateXoTestsTeam

func CreateXoTestsTeam(ctx context.Context, db DB, params *XoTestsTeamCreateParams) (*XoTestsTeam, error)

CreateXoTestsTeam creates a new XoTestsTeam in the database with the given params.

func XoTestsTeamByTeamID

func XoTestsTeamByTeamID(ctx context.Context, db DB, teamID XoTestsTeamID, opts ...XoTestsTeamSelectConfigOption) (*XoTestsTeam, error)

XoTestsTeamByTeamID retrieves a row from 'xo_tests.teams' as a XoTestsTeam.

Generated from index 'teams_pkey'.

func XoTestsTeamPaginated

func XoTestsTeamPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsTeamSelectConfigOption) ([]XoTestsTeam, error)

XoTestsTeamPaginated returns a cursor-paginated list of XoTestsTeam. At least one cursor is required.

func (*XoTestsTeam) Delete

func (xtt *XoTestsTeam) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsTeam from the database.

func (*XoTestsTeam) Insert

func (xtt *XoTestsTeam) Insert(ctx context.Context, db DB) (*XoTestsTeam, error)

Insert inserts the XoTestsTeam to the database.

func (*XoTestsTeam) SetUpdateParams

func (xtt *XoTestsTeam) SetUpdateParams(params *XoTestsTeamUpdateParams)

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

func (*XoTestsTeam) Update

func (xtt *XoTestsTeam) Update(ctx context.Context, db DB) (*XoTestsTeam, error)

Update updates a XoTestsTeam in the database.

func (*XoTestsTeam) Upsert

func (xtt *XoTestsTeam) Upsert(ctx context.Context, db DB, params *XoTestsTeamCreateParams) (*XoTestsTeam, error)

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

type XoTestsTeamCreateParams

type XoTestsTeamCreateParams struct {
	Name string `json:"name" required:"true" nullable:"false"` // name
}

XoTestsTeamCreateParams represents insert params for 'xo_tests.teams'.

func (XoTestsTeamCreateParams) GetName

func (p XoTestsTeamCreateParams) GetName() *string

type XoTestsTeamID

type XoTestsTeamID int

type XoTestsTeamJoins

type XoTestsTeamJoins struct{}

type XoTestsTeamParams

type XoTestsTeamParams interface {
	GetName() *string
}

XoTestsTeamParams represents common params for both insert and update of 'xo_tests.teams'.

type XoTestsTeamSelectConfig

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

type XoTestsTeamSelectConfigOption

type XoTestsTeamSelectConfigOption func(*XoTestsTeamSelectConfig)

func WithXoTestsTeamFilters

func WithXoTestsTeamFilters(filters map[string][]any) XoTestsTeamSelectConfigOption

WithXoTestsTeamFilters adds the given WHERE clause conditions, 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 WithXoTestsTeamHavingClause

func WithXoTestsTeamHavingClause(conditions map[string][]any) XoTestsTeamSelectConfigOption

WithXoTestsTeamHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsTeamJoin

func WithXoTestsTeamJoin(joins XoTestsTeamJoins) XoTestsTeamSelectConfigOption

WithXoTestsTeamJoin joins with the given tables.

func WithXoTestsTeamLimit

func WithXoTestsTeamLimit(limit int) XoTestsTeamSelectConfigOption

WithXoTestsTeamLimit limits row selection.

func WithXoTestsTeamOrderBy

func WithXoTestsTeamOrderBy(rows map[string]*Direction) XoTestsTeamSelectConfigOption

WithXoTestsTeamOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsTeamUpdateParams

type XoTestsTeamUpdateParams struct {
	Name *string `json:"name" nullable:"false"` // name
}

XoTestsTeamUpdateParams represents update params for 'xo_tests.teams'.

func (XoTestsTeamUpdateParams) GetName

func (p XoTestsTeamUpdateParams) GetName() *string

type XoTestsTimeEntry

type XoTestsTimeEntry struct {
	TimeEntryID XoTestsTimeEntryID `json:"timeEntryID" db:"time_entry_id" required:"true" nullable:"false"` // time_entry_id
	WorkItemID  *XoTestsWorkItemID `json:"workItemID" db:"work_item_id"`                                    // work_item_id
	Start       time.Time          `json:"start" db:"start" required:"true" nullable:"false"`               // start

	WorkItemJoin *XoTestsWorkItem `json:"-" db:"work_item_work_item_id"` // O2O work_items (generated from M2O)
}

XoTestsTimeEntry represents a row from 'xo_tests.time_entries'.

func CreateXoTestsTimeEntry

func CreateXoTestsTimeEntry(ctx context.Context, db DB, params *XoTestsTimeEntryCreateParams) (*XoTestsTimeEntry, error)

CreateXoTestsTimeEntry creates a new XoTestsTimeEntry in the database with the given params.

func XoTestsTimeEntryByTimeEntryID

func XoTestsTimeEntryByTimeEntryID(ctx context.Context, db DB, timeEntryID XoTestsTimeEntryID, opts ...XoTestsTimeEntrySelectConfigOption) (*XoTestsTimeEntry, error)

XoTestsTimeEntryByTimeEntryID retrieves a row from 'xo_tests.time_entries' as a XoTestsTimeEntry.

Generated from index 'time_entries_pkey'.

func XoTestsTimeEntryPaginated

func XoTestsTimeEntryPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsTimeEntrySelectConfigOption) ([]XoTestsTimeEntry, error)

XoTestsTimeEntryPaginated returns a cursor-paginated list of XoTestsTimeEntry. At least one cursor is required.

func (*XoTestsTimeEntry) Delete

func (xtte *XoTestsTimeEntry) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsTimeEntry from the database.

func (*XoTestsTimeEntry) FKWorkItem_WorkItemID

func (xtte *XoTestsTimeEntry) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*XoTestsWorkItem, error)

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

Generated from foreign key 'time_entries_work_item_id_fkey'.

func (*XoTestsTimeEntry) Insert

func (xtte *XoTestsTimeEntry) Insert(ctx context.Context, db DB) (*XoTestsTimeEntry, error)

Insert inserts the XoTestsTimeEntry to the database.

func (*XoTestsTimeEntry) SetUpdateParams

func (xtte *XoTestsTimeEntry) SetUpdateParams(params *XoTestsTimeEntryUpdateParams)

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

func (*XoTestsTimeEntry) Update

func (xtte *XoTestsTimeEntry) Update(ctx context.Context, db DB) (*XoTestsTimeEntry, error)

Update updates a XoTestsTimeEntry in the database.

func (*XoTestsTimeEntry) Upsert

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

type XoTestsTimeEntryCreateParams

type XoTestsTimeEntryCreateParams struct {
	Start      time.Time          `json:"start" required:"true" nullable:"false"` // start
	WorkItemID *XoTestsWorkItemID `json:"workItemID"`                             // work_item_id
}

XoTestsTimeEntryCreateParams represents insert params for 'xo_tests.time_entries'.

func (XoTestsTimeEntryCreateParams) GetStart

func (p XoTestsTimeEntryCreateParams) GetStart() *time.Time

func (XoTestsTimeEntryCreateParams) GetWorkItemID

type XoTestsTimeEntryID

type XoTestsTimeEntryID int

type XoTestsTimeEntryJoins

type XoTestsTimeEntryJoins struct {
	WorkItem bool `json:"workItem" required:"true" nullable:"false"` // O2O work_items
}

type XoTestsTimeEntryParams

type XoTestsTimeEntryParams interface {
	GetStart() *time.Time
	GetWorkItemID() *XoTestsWorkItemID
}

XoTestsTimeEntryParams represents common params for both insert and update of 'xo_tests.time_entries'.

type XoTestsTimeEntrySelectConfig

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

type XoTestsTimeEntrySelectConfigOption

type XoTestsTimeEntrySelectConfigOption func(*XoTestsTimeEntrySelectConfig)

func WithXoTestsTimeEntryFilters

func WithXoTestsTimeEntryFilters(filters map[string][]any) XoTestsTimeEntrySelectConfigOption

WithXoTestsTimeEntryFilters adds the given WHERE clause conditions, 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 WithXoTestsTimeEntryHavingClause

func WithXoTestsTimeEntryHavingClause(conditions map[string][]any) XoTestsTimeEntrySelectConfigOption

WithXoTestsTimeEntryHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsTimeEntryJoin

func WithXoTestsTimeEntryJoin(joins XoTestsTimeEntryJoins) XoTestsTimeEntrySelectConfigOption

WithXoTestsTimeEntryJoin joins with the given tables.

func WithXoTestsTimeEntryLimit

func WithXoTestsTimeEntryLimit(limit int) XoTestsTimeEntrySelectConfigOption

WithXoTestsTimeEntryLimit limits row selection.

func WithXoTestsTimeEntryOrderBy

func WithXoTestsTimeEntryOrderBy(rows map[string]*Direction) XoTestsTimeEntrySelectConfigOption

WithXoTestsTimeEntryOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsTimeEntryUpdateParams

type XoTestsTimeEntryUpdateParams struct {
	Start      *time.Time          `json:"start" nullable:"false"` // start
	WorkItemID **XoTestsWorkItemID `json:"workItemID"`             // work_item_id
}

XoTestsTimeEntryUpdateParams represents update params for 'xo_tests.time_entries'.

func (XoTestsTimeEntryUpdateParams) GetStart

func (p XoTestsTimeEntryUpdateParams) GetStart() *time.Time

func (XoTestsTimeEntryUpdateParams) GetWorkItemID

type XoTestsUser

type XoTestsUser struct {
	UserID    XoTestsUserID        `json:"userID" db:"user_id" required:"true" nullable:"false"`       // user_id
	Name      string               `json:"name" db:"name" required:"true" nullable:"false"`            // name
	APIKeyID  *XoTestsUserAPIKeyID `json:"apiKeyID" db:"api_key_id"`                                   // api_key_id
	CreatedAt time.Time            `json:"createdAt" db:"created_at" required:"true" nullable:"false"` // created_at
	DeletedAt *time.Time           `json:"deletedAt" db:"deleted_at"`                                  // deleted_at

	AuthorBooksJoin           *[]XoTestsUserM2MBookBA      `json:"-" db:"book_authors_books"`               // M2M book_authors
	AuthorBooksBASKJoin       *[]XoTestsUserM2MBookBASK    `json:"-" db:"book_authors_surrogate_key_books"` // M2M book_authors_surrogate_key
	BookReviewsJoin           *[]XoTestsBookReview         `json:"-" db:"book_reviews"`                     // M2O users
	SellerBooksJoin           *[]XoTestsBook               `json:"-" db:"book_sellers_books"`               // M2M book_sellers
	ReceiverNotificationsJoin *[]XoTestsNotification       `json:"-" db:"notifications_receiver"`           // M2O users
	SenderNotificationsJoin   *[]XoTestsNotification       `json:"-" db:"notifications_sender"`             // M2O users
	UserAPIKeyJoin            *XoTestsUserAPIKey           `json:"-" db:"user_api_key_api_key_id"`          // O2O user_api_keys (inferred)
	AssigneeWorkItemsJoin     *[]XoTestsUserM2MWorkItemWIA `json:"-" db:"work_item_assignee_work_items"`    // M2M work_item_assignee
	WorkItemCommentsJoin      *[]XoTestsWorkItemComment    `json:"-" db:"work_item_comments"`               // M2O users
}

XoTestsUser represents a row from 'xo_tests.users'.

func CreateXoTestsUser

func CreateXoTestsUser(ctx context.Context, db DB, params *XoTestsUserCreateParams) (*XoTestsUser, error)

CreateXoTestsUser creates a new XoTestsUser in the database with the given params.

func XoTestsUserByCreatedAt

func XoTestsUserByCreatedAt(ctx context.Context, db DB, createdAt time.Time, opts ...XoTestsUserSelectConfigOption) (*XoTestsUser, error)

XoTestsUserByCreatedAt retrieves a row from 'xo_tests.users' as a XoTestsUser.

Generated from index 'users_created_at_key'.

func XoTestsUserByName

func XoTestsUserByName(ctx context.Context, db DB, name string, opts ...XoTestsUserSelectConfigOption) (*XoTestsUser, error)

XoTestsUserByName retrieves a row from 'xo_tests.users' as a XoTestsUser.

Generated from index 'users_name_key'.

func XoTestsUserByUserID

func XoTestsUserByUserID(ctx context.Context, db DB, userID XoTestsUserID, opts ...XoTestsUserSelectConfigOption) (*XoTestsUser, error)

XoTestsUserByUserID retrieves a row from 'xo_tests.users' as a XoTestsUser.

Generated from index 'users_pkey'.

func XoTestsUserPaginated

func XoTestsUserPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsUserSelectConfigOption) ([]XoTestsUser, error)

XoTestsUserPaginated returns a cursor-paginated list of XoTestsUser. At least one cursor is required.

func (*XoTestsUser) Delete

func (xtu *XoTestsUser) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsUser from the database.

func (*XoTestsUser) FKUserAPIKey_APIKeyID

func (xtu *XoTestsUser) FKUserAPIKey_APIKeyID(ctx context.Context, db DB) (*XoTestsUserAPIKey, error)

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

Generated from foreign key 'users_api_key_id_fkey'.

func (*XoTestsUser) Insert

func (xtu *XoTestsUser) Insert(ctx context.Context, db DB) (*XoTestsUser, error)

Insert inserts the XoTestsUser to the database.

func (*XoTestsUser) Restore

func (xtu *XoTestsUser) Restore(ctx context.Context, db DB) (*XoTestsUser, error)

Restore restores a soft deleted XoTestsUser from the database.

func (*XoTestsUser) SetUpdateParams

func (xtu *XoTestsUser) SetUpdateParams(params *XoTestsUserUpdateParams)

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

func (*XoTestsUser) SoftDelete

func (xtu *XoTestsUser) SoftDelete(ctx context.Context, db DB) error

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

func (*XoTestsUser) Update

func (xtu *XoTestsUser) Update(ctx context.Context, db DB) (*XoTestsUser, error)

Update updates a XoTestsUser in the database.

func (*XoTestsUser) Upsert

func (xtu *XoTestsUser) Upsert(ctx context.Context, db DB, params *XoTestsUserCreateParams) (*XoTestsUser, error)

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

type XoTestsUserAPIKey

type XoTestsUserAPIKey struct {
	UserAPIKeyID XoTestsUserAPIKeyID `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       XoTestsUserID       `json:"userID" db:"user_id" required:"true" nullable:"false"`       // user_id

	UserJoin *XoTestsUser `json:"-" db:"user_user_id"` // O2O users (inferred)
}

XoTestsUserAPIKey represents a row from 'xo_tests.user_api_keys'.

func CreateXoTestsUserAPIKey

func CreateXoTestsUserAPIKey(ctx context.Context, db DB, params *XoTestsUserAPIKeyCreateParams) (*XoTestsUserAPIKey, error)

CreateXoTestsUserAPIKey creates a new XoTestsUserAPIKey in the database with the given params.

func XoTestsUserAPIKeyByAPIKey

func XoTestsUserAPIKeyByAPIKey(ctx context.Context, db DB, apiKey string, opts ...XoTestsUserAPIKeySelectConfigOption) (*XoTestsUserAPIKey, error)

XoTestsUserAPIKeyByAPIKey retrieves a row from 'xo_tests.user_api_keys' as a XoTestsUserAPIKey.

Generated from index 'user_api_keys_api_key_key'.

func XoTestsUserAPIKeyByUserAPIKeyID

func XoTestsUserAPIKeyByUserAPIKeyID(ctx context.Context, db DB, userAPIKeyID XoTestsUserAPIKeyID, opts ...XoTestsUserAPIKeySelectConfigOption) (*XoTestsUserAPIKey, error)

XoTestsUserAPIKeyByUserAPIKeyID retrieves a row from 'xo_tests.user_api_keys' as a XoTestsUserAPIKey.

Generated from index 'user_api_keys_pkey'.

func XoTestsUserAPIKeyByUserID

func XoTestsUserAPIKeyByUserID(ctx context.Context, db DB, userID XoTestsUserID, opts ...XoTestsUserAPIKeySelectConfigOption) (*XoTestsUserAPIKey, error)

XoTestsUserAPIKeyByUserID retrieves a row from 'xo_tests.user_api_keys' as a XoTestsUserAPIKey.

Generated from index 'user_api_keys_user_id_key'.

func XoTestsUserAPIKeyPaginated

func XoTestsUserAPIKeyPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsUserAPIKeySelectConfigOption) ([]XoTestsUserAPIKey, error)

XoTestsUserAPIKeyPaginated returns a cursor-paginated list of XoTestsUserAPIKey. At least one cursor is required.

func (*XoTestsUserAPIKey) Delete

func (xtuak *XoTestsUserAPIKey) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsUserAPIKey from the database.

func (*XoTestsUserAPIKey) FKUser_UserID

func (xtuak *XoTestsUserAPIKey) FKUser_UserID(ctx context.Context, db DB) (*XoTestsUser, error)

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

Generated from foreign key 'user_api_keys_user_id_fkey'.

func (*XoTestsUserAPIKey) Insert

func (xtuak *XoTestsUserAPIKey) Insert(ctx context.Context, db DB) (*XoTestsUserAPIKey, error)

Insert inserts the XoTestsUserAPIKey to the database.

func (*XoTestsUserAPIKey) SetUpdateParams

func (xtuak *XoTestsUserAPIKey) SetUpdateParams(params *XoTestsUserAPIKeyUpdateParams)

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

func (*XoTestsUserAPIKey) Update

func (xtuak *XoTestsUserAPIKey) Update(ctx context.Context, db DB) (*XoTestsUserAPIKey, error)

Update updates a XoTestsUserAPIKey in the database.

func (*XoTestsUserAPIKey) Upsert

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

type XoTestsUserAPIKeyCreateParams

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

XoTestsUserAPIKeyCreateParams represents insert params for 'xo_tests.user_api_keys'.

func (XoTestsUserAPIKeyCreateParams) GetAPIKey

func (p XoTestsUserAPIKeyCreateParams) GetAPIKey() *string

func (XoTestsUserAPIKeyCreateParams) GetExpiresOn

func (p XoTestsUserAPIKeyCreateParams) GetExpiresOn() *time.Time

func (XoTestsUserAPIKeyCreateParams) GetUserID

type XoTestsUserAPIKeyID

type XoTestsUserAPIKeyID int

type XoTestsUserAPIKeyJoins

type XoTestsUserAPIKeyJoins struct {
	User bool `json:"user" required:"true" nullable:"false"` // O2O users
}

type XoTestsUserAPIKeyParams

type XoTestsUserAPIKeyParams interface {
	GetAPIKey() *string
	GetExpiresOn() *time.Time
	GetUserID() *XoTestsUserID
}

XoTestsUserAPIKeyParams represents common params for both insert and update of 'xo_tests.user_api_keys'.

type XoTestsUserAPIKeySelectConfig

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

type XoTestsUserAPIKeySelectConfigOption

type XoTestsUserAPIKeySelectConfigOption func(*XoTestsUserAPIKeySelectConfig)

func WithXoTestsUserAPIKeyFilters

func WithXoTestsUserAPIKeyFilters(filters map[string][]any) XoTestsUserAPIKeySelectConfigOption

WithXoTestsUserAPIKeyFilters adds the given WHERE clause conditions, 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 WithXoTestsUserAPIKeyHavingClause

func WithXoTestsUserAPIKeyHavingClause(conditions map[string][]any) XoTestsUserAPIKeySelectConfigOption

WithXoTestsUserAPIKeyHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsUserAPIKeyJoin

func WithXoTestsUserAPIKeyJoin(joins XoTestsUserAPIKeyJoins) XoTestsUserAPIKeySelectConfigOption

WithXoTestsUserAPIKeyJoin joins with the given tables.

func WithXoTestsUserAPIKeyLimit

func WithXoTestsUserAPIKeyLimit(limit int) XoTestsUserAPIKeySelectConfigOption

WithXoTestsUserAPIKeyLimit limits row selection.

func WithXoTestsUserAPIKeyOrderBy

func WithXoTestsUserAPIKeyOrderBy(rows map[string]*Direction) XoTestsUserAPIKeySelectConfigOption

WithXoTestsUserAPIKeyOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsUserAPIKeyUpdateParams

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

XoTestsUserAPIKeyUpdateParams represents update params for 'xo_tests.user_api_keys'.

func (XoTestsUserAPIKeyUpdateParams) GetAPIKey

func (p XoTestsUserAPIKeyUpdateParams) GetAPIKey() *string

func (XoTestsUserAPIKeyUpdateParams) GetExpiresOn

func (p XoTestsUserAPIKeyUpdateParams) GetExpiresOn() *time.Time

func (XoTestsUserAPIKeyUpdateParams) GetUserID

type XoTestsUserCreateParams

type XoTestsUserCreateParams struct {
	APIKeyID *XoTestsUserAPIKeyID `json:"apiKeyID"`                              // api_key_id
	Name     string               `json:"name" required:"true" nullable:"false"` // name
}

XoTestsUserCreateParams represents insert params for 'xo_tests.users'.

func (XoTestsUserCreateParams) GetAPIKeyID

func (XoTestsUserCreateParams) GetName

func (p XoTestsUserCreateParams) GetName() *string

type XoTestsUserID

type XoTestsUserID struct {
	uuid.UUID
}

func NewXoTestsUserID

func NewXoTestsUserID(id uuid.UUID) XoTestsUserID

type XoTestsUserJoins

type XoTestsUserJoins struct {
	AuthorBooks           bool `json:"authorBooks" required:"true" nullable:"false"`           // M2M book_authors
	AuthorBooksBASK       bool `json:"authorBooksBASK" required:"true" nullable:"false"`       // M2M book_authors_surrogate_key
	BookReviews           bool `json:"bookReviews" required:"true" nullable:"false"`           // M2O book_reviews
	SellerBooks           bool `json:"sellerBooks" required:"true" nullable:"false"`           // M2M book_sellers
	ReceiverNotifications bool `json:"receiverNotifications" required:"true" nullable:"false"` // M2O notifications
	SenderNotifications   bool `json:"senderNotifications" required:"true" nullable:"false"`   // M2O notifications
	UserAPIKey            bool `json:"userAPIKey" required:"true" nullable:"false"`            // O2O user_api_keys
	AssigneeWorkItems     bool `json:"assigneeWorkItems" required:"true" nullable:"false"`     // M2M work_item_assignee
	WorkItemComments      bool `json:"workItemComments" required:"true" nullable:"false"`      // M2O work_item_comments
}

type XoTestsUserM2MBookBA

type XoTestsUserM2MBookBA struct {
	Book      XoTestsBook `json:"book" db:"books" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsUserM2MBookBA represents a M2M join against "xo_tests.book_authors"

type XoTestsUserM2MBookBASK

type XoTestsUserM2MBookBASK struct {
	Book      XoTestsBook `json:"book" db:"books" required:"true"`
	Pseudonym *string     `json:"pseudonym" db:"pseudonym" required:"true" `
}

XoTestsUserM2MBookBASK represents a M2M join against "xo_tests.book_authors_surrogate_key"

type XoTestsUserM2MWorkItemWIA

type XoTestsUserM2MWorkItemWIA struct {
	WorkItem XoTestsWorkItem      `json:"workItem" db:"work_items" required:"true"`
	Role     *XoTestsWorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

XoTestsUserM2MWorkItemWIA represents a M2M join against "xo_tests.work_item_assignee"

type XoTestsUserParams

type XoTestsUserParams interface {
	GetAPIKeyID() *XoTestsUserAPIKeyID
	GetName() *string
}

XoTestsUserParams represents common params for both insert and update of 'xo_tests.users'.

type XoTestsUserSelectConfig

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

type XoTestsUserSelectConfigOption

type XoTestsUserSelectConfigOption func(*XoTestsUserSelectConfig)

func WithDeletedXoTestsUserOnly

func WithDeletedXoTestsUserOnly() XoTestsUserSelectConfigOption

WithDeletedXoTestsUserOnly limits result to records marked as deleted.

func WithXoTestsUserFilters

func WithXoTestsUserFilters(filters map[string][]any) XoTestsUserSelectConfigOption

WithXoTestsUserFilters adds the given WHERE clause conditions, 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 WithXoTestsUserHavingClause

func WithXoTestsUserHavingClause(conditions map[string][]any) XoTestsUserSelectConfigOption

WithXoTestsUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsUserJoin

func WithXoTestsUserJoin(joins XoTestsUserJoins) XoTestsUserSelectConfigOption

WithXoTestsUserJoin joins with the given tables.

func WithXoTestsUserLimit

func WithXoTestsUserLimit(limit int) XoTestsUserSelectConfigOption

WithXoTestsUserLimit limits row selection.

func WithXoTestsUserOrderBy

func WithXoTestsUserOrderBy(rows map[string]*Direction) XoTestsUserSelectConfigOption

WithXoTestsUserOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsUserUpdateParams

type XoTestsUserUpdateParams struct {
	APIKeyID **XoTestsUserAPIKeyID `json:"apiKeyID"`              // api_key_id
	Name     *string               `json:"name" nullable:"false"` // name
}

XoTestsUserUpdateParams represents update params for 'xo_tests.users'.

func (XoTestsUserUpdateParams) GetAPIKeyID

func (XoTestsUserUpdateParams) GetName

func (p XoTestsUserUpdateParams) GetName() *string

type XoTestsWorkItem

type XoTestsWorkItem struct {
	WorkItemID  XoTestsWorkItemID `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"` // work_item_id
	Title       *string           `json:"title" db:"title"`                                              // title
	Description *string           `json:"description" db:"description"`                                  // description
	TeamID      XoTestsTeamID     `json:"teamID" db:"team_id" required:"true" nullable:"false"`          // team_id

	DemoWorkItemJoin     *XoTestsDemoWorkItem             `json:"-" db:"demo_work_item_work_item_id"`  // O2O demo_work_items (inferred)
	TimeEntriesJoin      *[]XoTestsTimeEntry              `json:"-" db:"time_entries"`                 // M2O work_items
	AssigneesJoin        *[]XoTestsWorkItemM2MAssigneeWIA `json:"-" db:"work_item_assignee_assignees"` // M2M work_item_assignee
	WorkItemCommentsJoin *[]XoTestsWorkItemComment        `json:"-" db:"work_item_comments"`           // M2O work_items
	TeamJoin             *XoTestsTeam                     `json:"-" db:"team_team_id"`                 // O2O teams (inferred)
}

XoTestsWorkItem represents a row from 'xo_tests.work_items'.

func CreateXoTestsWorkItem

func CreateXoTestsWorkItem(ctx context.Context, db DB, params *XoTestsWorkItemCreateParams) (*XoTestsWorkItem, error)

CreateXoTestsWorkItem creates a new XoTestsWorkItem in the database with the given params.

func XoTestsWorkItemByWorkItemID

func XoTestsWorkItemByWorkItemID(ctx context.Context, db DB, workItemID XoTestsWorkItemID, opts ...XoTestsWorkItemSelectConfigOption) (*XoTestsWorkItem, error)

XoTestsWorkItemByWorkItemID retrieves a row from 'xo_tests.work_items' as a XoTestsWorkItem.

Generated from index 'work_items_pkey'.

func XoTestsWorkItemPaginated

func XoTestsWorkItemPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsWorkItemSelectConfigOption) ([]XoTestsWorkItem, error)

XoTestsWorkItemPaginated returns a cursor-paginated list of XoTestsWorkItem. At least one cursor is required.

func XoTestsWorkItems

func XoTestsWorkItems(ctx context.Context, db DB, opts ...XoTestsWorkItemSelectConfigOption) ([]XoTestsWorkItem, error)

XoTestsWorkItems retrieves a row from 'xo_tests.work_items' as a XoTestsWorkItem.

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

func XoTestsWorkItemsByTitle

func XoTestsWorkItemsByTitle(ctx context.Context, db DB, title *string, opts ...XoTestsWorkItemSelectConfigOption) ([]XoTestsWorkItem, error)

XoTestsWorkItemsByTitle retrieves a row from 'xo_tests.work_items' as a XoTestsWorkItem.

Generated from index 'work_items_title_description_idx1'.

func (*XoTestsWorkItem) Delete

func (xtwi *XoTestsWorkItem) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsWorkItem from the database.

func (*XoTestsWorkItem) FKTeam_TeamID

func (xtwi *XoTestsWorkItem) FKTeam_TeamID(ctx context.Context, db DB) (*XoTestsTeam, error)

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

Generated from foreign key 'work_items_team_id_fkey'.

func (*XoTestsWorkItem) Insert

func (xtwi *XoTestsWorkItem) Insert(ctx context.Context, db DB) (*XoTestsWorkItem, error)

Insert inserts the XoTestsWorkItem to the database.

func (*XoTestsWorkItem) SetUpdateParams

func (xtwi *XoTestsWorkItem) SetUpdateParams(params *XoTestsWorkItemUpdateParams)

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

func (*XoTestsWorkItem) Update

func (xtwi *XoTestsWorkItem) Update(ctx context.Context, db DB) (*XoTestsWorkItem, error)

Update updates a XoTestsWorkItem in the database.

func (*XoTestsWorkItem) Upsert

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

type XoTestsWorkItemAssignee

type XoTestsWorkItemAssignee struct {
	WorkItemID  XoTestsWorkItemID    `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`                           // work_item_id
	Assignee    XoTestsUserID        `json:"assignee" db:"assignee" required:"true" nullable:"false"`                                 // assignee
	XoTestsRole *XoTestsWorkItemRole `json:"role" db:"role" required:"true" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role

	WorkItemsJoin *[]XoTestsWorkItemAssigneeM2MWorkItemWIA `json:"-" db:"work_item_assignee_work_items"` // M2M work_item_assignee
	AssigneesJoin *[]XoTestsWorkItemAssigneeM2MAssigneeWIA `json:"-" db:"work_item_assignee_assignees"`  // M2M work_item_assignee
}

XoTestsWorkItemAssignee represents a row from 'xo_tests.work_item_assignee'.

func CreateXoTestsWorkItemAssignee

func CreateXoTestsWorkItemAssignee(ctx context.Context, db DB, params *XoTestsWorkItemAssigneeCreateParams) (*XoTestsWorkItemAssignee, error)

CreateXoTestsWorkItemAssignee creates a new XoTestsWorkItemAssignee in the database with the given params.

func XoTestsWorkItemAssigneeByWorkItemIDAssignee

func XoTestsWorkItemAssigneeByWorkItemIDAssignee(ctx context.Context, db DB, workItemID XoTestsWorkItemID, assignee XoTestsUserID, opts ...XoTestsWorkItemAssigneeSelectConfigOption) (*XoTestsWorkItemAssignee, error)

XoTestsWorkItemAssigneeByWorkItemIDAssignee retrieves a row from 'xo_tests.work_item_assignee' as a XoTestsWorkItemAssignee.

Generated from index 'work_item_assignee_pkey'.

func XoTestsWorkItemAssigneePaginated

func XoTestsWorkItemAssigneePaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsWorkItemAssigneeSelectConfigOption) ([]XoTestsWorkItemAssignee, error)

XoTestsWorkItemAssigneePaginated returns a cursor-paginated list of XoTestsWorkItemAssignee. At least one cursor is required.

func XoTestsWorkItemAssigneesByAssignee

func XoTestsWorkItemAssigneesByAssignee(ctx context.Context, db DB, assignee XoTestsUserID, opts ...XoTestsWorkItemAssigneeSelectConfigOption) ([]XoTestsWorkItemAssignee, error)

XoTestsWorkItemAssigneesByAssignee retrieves a row from 'xo_tests.work_item_assignee' as a XoTestsWorkItemAssignee.

Generated from index 'work_item_assignee_pkey'.

func XoTestsWorkItemAssigneesByAssigneeWorkItemID

func XoTestsWorkItemAssigneesByAssigneeWorkItemID(ctx context.Context, db DB, assignee XoTestsUserID, workItemID XoTestsWorkItemID, opts ...XoTestsWorkItemAssigneeSelectConfigOption) ([]XoTestsWorkItemAssignee, error)

XoTestsWorkItemAssigneesByAssigneeWorkItemID retrieves a row from 'xo_tests.work_item_assignee' as a XoTestsWorkItemAssignee.

Generated from index 'work_item_assignee_assignee_work_item_id_idx'.

func XoTestsWorkItemAssigneesByWorkItemID

func XoTestsWorkItemAssigneesByWorkItemID(ctx context.Context, db DB, workItemID XoTestsWorkItemID, opts ...XoTestsWorkItemAssigneeSelectConfigOption) ([]XoTestsWorkItemAssignee, error)

XoTestsWorkItemAssigneesByWorkItemID retrieves a row from 'xo_tests.work_item_assignee' as a XoTestsWorkItemAssignee.

Generated from index 'work_item_assignee_pkey'.

func (*XoTestsWorkItemAssignee) Delete

func (xtwia *XoTestsWorkItemAssignee) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsWorkItemAssignee from the database.

func (*XoTestsWorkItemAssignee) FKUser_Assignee

func (xtwia *XoTestsWorkItemAssignee) FKUser_Assignee(ctx context.Context, db DB) (*XoTestsUser, error)

FKUser_Assignee returns the User associated with the XoTestsWorkItemAssignee's (Assignee).

Generated from foreign key 'work_item_assignee_assignee_fkey'.

func (*XoTestsWorkItemAssignee) FKWorkItem_WorkItemID

func (xtwia *XoTestsWorkItemAssignee) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*XoTestsWorkItem, error)

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

Generated from foreign key 'work_item_assignee_work_item_id_fkey'.

func (*XoTestsWorkItemAssignee) Insert

Insert inserts the XoTestsWorkItemAssignee to the database.

func (*XoTestsWorkItemAssignee) SetUpdateParams

func (xtwia *XoTestsWorkItemAssignee) SetUpdateParams(params *XoTestsWorkItemAssigneeUpdateParams)

SetUpdateParams updates xo_tests.work_item_assignee struct fields with the specified params.

func (*XoTestsWorkItemAssignee) Update

Update updates a XoTestsWorkItemAssignee in the database.

func (*XoTestsWorkItemAssignee) Upsert

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

type XoTestsWorkItemAssigneeCreateParams

type XoTestsWorkItemAssigneeCreateParams struct {
	Assignee    XoTestsUserID        `json:"assignee" required:"true" nullable:"false"`                                     // assignee
	XoTestsRole *XoTestsWorkItemRole `json:"role" required:"true" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role
	WorkItemID  XoTestsWorkItemID    `json:"workItemID" required:"true" nullable:"false"`                                   // work_item_id
}

XoTestsWorkItemAssigneeCreateParams represents insert params for 'xo_tests.work_item_assignee'.

func (XoTestsWorkItemAssigneeCreateParams) GetAssignee

func (XoTestsWorkItemAssigneeCreateParams) GetWorkItemID

func (XoTestsWorkItemAssigneeCreateParams) GetXoTestsRole

type XoTestsWorkItemAssigneeJoins

type XoTestsWorkItemAssigneeJoins struct {
	WorkItems bool `json:"workItems" required:"true" nullable:"false"` // M2M work_item_assignee
	Assignees bool `json:"assignees" required:"true" nullable:"false"` // M2M work_item_assignee
}

type XoTestsWorkItemAssigneeM2MAssigneeWIA

type XoTestsWorkItemAssigneeM2MAssigneeWIA struct {
	User XoTestsUser          `json:"user" db:"users" required:"true"`
	Role *XoTestsWorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

XoTestsWorkItemAssigneeM2MAssigneeWIA represents a M2M join against "xo_tests.work_item_assignee"

type XoTestsWorkItemAssigneeM2MWorkItemWIA

type XoTestsWorkItemAssigneeM2MWorkItemWIA struct {
	WorkItem XoTestsWorkItem      `json:"workItem" db:"work_items" required:"true"`
	Role     *XoTestsWorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

XoTestsWorkItemAssigneeM2MWorkItemWIA represents a M2M join against "xo_tests.work_item_assignee"

type XoTestsWorkItemAssigneeParams

type XoTestsWorkItemAssigneeParams interface {
	GetAssignee() *XoTestsUserID
	GetXoTestsRole() *XoTestsWorkItemRole
	GetWorkItemID() *XoTestsWorkItemID
}

XoTestsWorkItemAssigneeParams represents common params for both insert and update of 'xo_tests.work_item_assignee'.

type XoTestsWorkItemAssigneeSelectConfig

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

type XoTestsWorkItemAssigneeSelectConfigOption

type XoTestsWorkItemAssigneeSelectConfigOption func(*XoTestsWorkItemAssigneeSelectConfig)

func WithXoTestsWorkItemAssigneeFilters

func WithXoTestsWorkItemAssigneeFilters(filters map[string][]any) XoTestsWorkItemAssigneeSelectConfigOption

WithXoTestsWorkItemAssigneeFilters adds the given WHERE clause conditions, 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 WithXoTestsWorkItemAssigneeHavingClause

func WithXoTestsWorkItemAssigneeHavingClause(conditions map[string][]any) XoTestsWorkItemAssigneeSelectConfigOption

WithXoTestsWorkItemAssigneeHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsWorkItemAssigneeJoin

func WithXoTestsWorkItemAssigneeJoin(joins XoTestsWorkItemAssigneeJoins) XoTestsWorkItemAssigneeSelectConfigOption

WithXoTestsWorkItemAssigneeJoin joins with the given tables.

func WithXoTestsWorkItemAssigneeLimit

func WithXoTestsWorkItemAssigneeLimit(limit int) XoTestsWorkItemAssigneeSelectConfigOption

WithXoTestsWorkItemAssigneeLimit limits row selection.

func WithXoTestsWorkItemAssigneeOrderBy

func WithXoTestsWorkItemAssigneeOrderBy(rows map[string]*Direction) XoTestsWorkItemAssigneeSelectConfigOption

WithXoTestsWorkItemAssigneeOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsWorkItemAssigneeUpdateParams

type XoTestsWorkItemAssigneeUpdateParams struct {
	Assignee    *XoTestsUserID        `json:"assignee" nullable:"false"`                                     // assignee
	XoTestsRole **XoTestsWorkItemRole `json:"role" nullable:"false" ref:"#/components/schemas/WorkItemRole"` // role
	WorkItemID  *XoTestsWorkItemID    `json:"workItemID" nullable:"false"`                                   // work_item_id
}

XoTestsWorkItemAssigneeUpdateParams represents update params for 'xo_tests.work_item_assignee'.

func (XoTestsWorkItemAssigneeUpdateParams) GetAssignee

func (XoTestsWorkItemAssigneeUpdateParams) GetWorkItemID

func (XoTestsWorkItemAssigneeUpdateParams) GetXoTestsRole

type XoTestsWorkItemComment

type XoTestsWorkItemComment struct {
	WorkItemCommentID XoTestsWorkItemCommentID `json:"workItemCommentID" db:"work_item_comment_id" required:"true" nullable:"false"` // work_item_comment_id
	WorkItemID        XoTestsWorkItemID        `json:"workItemID" db:"work_item_id" required:"true" nullable:"false"`                // work_item_id
	UserID            XoTestsUserID            `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     *XoTestsUser     `json:"-" db:"user_user_id"`           // O2O users (generated from M2O)
	WorkItemJoin *XoTestsWorkItem `json:"-" db:"work_item_work_item_id"` // O2O work_items (generated from M2O)
}

XoTestsWorkItemComment represents a row from 'xo_tests.work_item_comments'.

func CreateXoTestsWorkItemComment

func CreateXoTestsWorkItemComment(ctx context.Context, db DB, params *XoTestsWorkItemCommentCreateParams) (*XoTestsWorkItemComment, error)

CreateXoTestsWorkItemComment creates a new XoTestsWorkItemComment in the database with the given params.

func XoTestsWorkItemCommentByWorkItemCommentID

func XoTestsWorkItemCommentByWorkItemCommentID(ctx context.Context, db DB, workItemCommentID XoTestsWorkItemCommentID, opts ...XoTestsWorkItemCommentSelectConfigOption) (*XoTestsWorkItemComment, error)

XoTestsWorkItemCommentByWorkItemCommentID retrieves a row from 'xo_tests.work_item_comments' as a XoTestsWorkItemComment.

Generated from index 'work_item_comments_pkey'.

func XoTestsWorkItemCommentPaginated

func XoTestsWorkItemCommentPaginated(ctx context.Context, db DB, cursor PaginationCursor, opts ...XoTestsWorkItemCommentSelectConfigOption) ([]XoTestsWorkItemComment, error)

XoTestsWorkItemCommentPaginated returns a cursor-paginated list of XoTestsWorkItemComment. At least one cursor is required.

func XoTestsWorkItemCommentsByWorkItemID

func XoTestsWorkItemCommentsByWorkItemID(ctx context.Context, db DB, workItemID XoTestsWorkItemID, opts ...XoTestsWorkItemCommentSelectConfigOption) ([]XoTestsWorkItemComment, error)

XoTestsWorkItemCommentsByWorkItemID retrieves a row from 'xo_tests.work_item_comments' as a XoTestsWorkItemComment.

Generated from index 'work_item_comments_work_item_id_idx'.

func (*XoTestsWorkItemComment) Delete

func (xtwic *XoTestsWorkItemComment) Delete(ctx context.Context, db DB) error

Delete deletes the XoTestsWorkItemComment from the database.

func (*XoTestsWorkItemComment) FKUser_UserID

func (xtwic *XoTestsWorkItemComment) FKUser_UserID(ctx context.Context, db DB) (*XoTestsUser, error)

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

Generated from foreign key 'work_item_comments_user_id_fkey'.

func (*XoTestsWorkItemComment) FKWorkItem_WorkItemID

func (xtwic *XoTestsWorkItemComment) FKWorkItem_WorkItemID(ctx context.Context, db DB) (*XoTestsWorkItem, error)

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

Generated from foreign key 'work_item_comments_work_item_id_fkey'.

func (*XoTestsWorkItemComment) Insert

Insert inserts the XoTestsWorkItemComment to the database.

func (*XoTestsWorkItemComment) SetUpdateParams

func (xtwic *XoTestsWorkItemComment) SetUpdateParams(params *XoTestsWorkItemCommentUpdateParams)

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

func (*XoTestsWorkItemComment) Update

Update updates a XoTestsWorkItemComment in the database.

func (*XoTestsWorkItemComment) Upsert

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

type XoTestsWorkItemCommentCreateParams

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

XoTestsWorkItemCommentCreateParams represents insert params for 'xo_tests.work_item_comments'.

func (XoTestsWorkItemCommentCreateParams) GetMessage

func (XoTestsWorkItemCommentCreateParams) GetUserID

func (XoTestsWorkItemCommentCreateParams) GetWorkItemID

type XoTestsWorkItemCommentID

type XoTestsWorkItemCommentID int

type XoTestsWorkItemCommentJoins

type XoTestsWorkItemCommentJoins struct {
	User     bool `json:"user" required:"true" nullable:"false"`     // O2O users
	WorkItem bool `json:"workItem" required:"true" nullable:"false"` // O2O work_items
}

type XoTestsWorkItemCommentParams

type XoTestsWorkItemCommentParams interface {
	GetMessage() *string
	GetUserID() *XoTestsUserID
	GetWorkItemID() *XoTestsWorkItemID
}

XoTestsWorkItemCommentParams represents common params for both insert and update of 'xo_tests.work_item_comments'.

type XoTestsWorkItemCommentSelectConfig

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

type XoTestsWorkItemCommentSelectConfigOption

type XoTestsWorkItemCommentSelectConfigOption func(*XoTestsWorkItemCommentSelectConfig)

func WithXoTestsWorkItemCommentFilters

func WithXoTestsWorkItemCommentFilters(filters map[string][]any) XoTestsWorkItemCommentSelectConfigOption

WithXoTestsWorkItemCommentFilters adds the given WHERE clause conditions, 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 WithXoTestsWorkItemCommentHavingClause

func WithXoTestsWorkItemCommentHavingClause(conditions map[string][]any) XoTestsWorkItemCommentSelectConfigOption

WithXoTestsWorkItemCommentHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsWorkItemCommentJoin

func WithXoTestsWorkItemCommentJoin(joins XoTestsWorkItemCommentJoins) XoTestsWorkItemCommentSelectConfigOption

WithXoTestsWorkItemCommentJoin joins with the given tables.

func WithXoTestsWorkItemCommentLimit

func WithXoTestsWorkItemCommentLimit(limit int) XoTestsWorkItemCommentSelectConfigOption

WithXoTestsWorkItemCommentLimit limits row selection.

func WithXoTestsWorkItemCommentOrderBy

func WithXoTestsWorkItemCommentOrderBy(rows map[string]*Direction) XoTestsWorkItemCommentSelectConfigOption

WithXoTestsWorkItemCommentOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsWorkItemCommentUpdateParams

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

XoTestsWorkItemCommentUpdateParams represents update params for 'xo_tests.work_item_comments'.

func (XoTestsWorkItemCommentUpdateParams) GetMessage

func (XoTestsWorkItemCommentUpdateParams) GetUserID

func (XoTestsWorkItemCommentUpdateParams) GetWorkItemID

type XoTestsWorkItemCreateParams

type XoTestsWorkItemCreateParams struct {
	Description *string       `json:"description"`                             // description
	TeamID      XoTestsTeamID `json:"teamID" required:"true" nullable:"false"` // team_id
	Title       *string       `json:"title"`                                   // title
}

XoTestsWorkItemCreateParams represents insert params for 'xo_tests.work_items'.

func (XoTestsWorkItemCreateParams) GetDescription

func (p XoTestsWorkItemCreateParams) GetDescription() *string

func (XoTestsWorkItemCreateParams) GetTeamID

func (XoTestsWorkItemCreateParams) GetTitle

func (p XoTestsWorkItemCreateParams) GetTitle() *string

type XoTestsWorkItemID

type XoTestsWorkItemID int

type XoTestsWorkItemJoins

type XoTestsWorkItemJoins struct {
	DemoWorkItem     bool `json:"demoWorkItem" required:"true" nullable:"false"`     // O2O demo_work_items
	TimeEntries      bool `json:"timeEntries" required:"true" nullable:"false"`      // M2O time_entries
	Assignees        bool `json:"assignees" required:"true" nullable:"false"`        // M2M work_item_assignee
	WorkItemComments bool `json:"workItemComments" required:"true" nullable:"false"` // M2O work_item_comments
	Team             bool `json:"team" required:"true" nullable:"false"`             // O2O teams
}

type XoTestsWorkItemM2MAssigneeWIA

type XoTestsWorkItemM2MAssigneeWIA struct {
	User XoTestsUser          `json:"user" db:"users" required:"true"`
	Role *XoTestsWorkItemRole `json:"role" db:"role" required:"true" ref:"#/components/schemas/WorkItemRole" `
}

XoTestsWorkItemM2MAssigneeWIA represents a M2M join against "xo_tests.work_item_assignee"

type XoTestsWorkItemParams

type XoTestsWorkItemParams interface {
	GetDescription() *string
	GetTeamID() *XoTestsTeamID
	GetTitle() *string
}

XoTestsWorkItemParams represents common params for both insert and update of 'xo_tests.work_items'.

type XoTestsWorkItemRole

type XoTestsWorkItemRole string

XoTestsWorkItemRole is the 'work_item_role' enum type from schema 'xo_tests'.

const (
	// XoTestsWorkItemRolePreparer is the 'preparer' work_item_role.
	XoTestsWorkItemRolePreparer XoTestsWorkItemRole = "preparer"
	// XoTestsWorkItemRoleReviewer is the 'reviewer' work_item_role.
	XoTestsWorkItemRoleReviewer XoTestsWorkItemRole = "reviewer"
)

XoTestsWorkItemRole values.

func AllXoTestsWorkItemRoleValues

func AllXoTestsWorkItemRoleValues() []XoTestsWorkItemRole

func (*XoTestsWorkItemRole) Scan

func (xtwir *XoTestsWorkItemRole) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface.

func (XoTestsWorkItemRole) Value

func (xtwir XoTestsWorkItemRole) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface.

type XoTestsWorkItemSelectConfig

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

type XoTestsWorkItemSelectConfigOption

type XoTestsWorkItemSelectConfigOption func(*XoTestsWorkItemSelectConfig)

func WithXoTestsWorkItemFilters

func WithXoTestsWorkItemFilters(filters map[string][]any) XoTestsWorkItemSelectConfigOption

WithXoTestsWorkItemFilters adds the given WHERE clause conditions, 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 WithXoTestsWorkItemHavingClause

func WithXoTestsWorkItemHavingClause(conditions map[string][]any) XoTestsWorkItemSelectConfigOption

WithXoTestsWorkItemHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example: WithUserHavingClause adds the given HAVING clause conditions, which can be dynamically parameterized with $i to prevent SQL injection. Example:

// filter a given aggregate of assigned users to return results where at least one of them has id of userId.
// See xo_join_* alias used by the join db tag in the SelectSQL string.
filters := map[string][]any{
"$i = ANY(ARRAY_AGG(xo_join_assigned_users_join.user_id))": {userId},
}

func WithXoTestsWorkItemJoin

func WithXoTestsWorkItemJoin(joins XoTestsWorkItemJoins) XoTestsWorkItemSelectConfigOption

WithXoTestsWorkItemJoin joins with the given tables.

func WithXoTestsWorkItemLimit

func WithXoTestsWorkItemLimit(limit int) XoTestsWorkItemSelectConfigOption

WithXoTestsWorkItemLimit limits row selection.

func WithXoTestsWorkItemOrderBy

func WithXoTestsWorkItemOrderBy(rows map[string]*Direction) XoTestsWorkItemSelectConfigOption

WithXoTestsWorkItemOrderBy accumulates orders results by the given columns. A nil entry removes the existing column sort, if any.

type XoTestsWorkItemUpdateParams

type XoTestsWorkItemUpdateParams struct {
	Description **string       `json:"description"`             // description
	TeamID      *XoTestsTeamID `json:"teamID" nullable:"false"` // team_id
	Title       **string       `json:"title"`                   // title
}

XoTestsWorkItemUpdateParams represents update params for 'xo_tests.work_items'.

func (XoTestsWorkItemUpdateParams) GetDescription

func (p XoTestsWorkItemUpdateParams) GetDescription() *string

func (XoTestsWorkItemUpdateParams) GetTeamID

func (XoTestsWorkItemUpdateParams) GetTitle

func (p XoTestsWorkItemUpdateParams) GetTitle() *string

Jump to

Keyboard shortcuts

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