Loggest thy stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

628 lines
28 KiB

// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.13.0
package mysqlcore
import (
"context"
"database/sql"
"fmt"
)
type DBTX interface {
ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
PrepareContext(context.Context, string) (*sql.Stmt, error)
QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}
func New(db DBTX) *Queries {
return &Queries{db: db}
}
func Prepare(ctx context.Context, db DBTX) (*Queries, error) {
q := Queries{db: db}
var err error
if q.cLearItemStatProgressByStatStmt, err = db.PrepareContext(ctx, cLearItemStatProgressByStat); err != nil {
return nil, fmt.Errorf("error preparing query CLearItemStatProgressByStat: %w", err)
}
if q.clearItemProjectRequirementStmt, err = db.PrepareContext(ctx, clearItemProjectRequirement); err != nil {
return nil, fmt.Errorf("error preparing query ClearItemProjectRequirement: %w", err)
}
if q.clearItemProjectRequirementByProjectIDStmt, err = db.PrepareContext(ctx, clearItemProjectRequirementByProjectID); err != nil {
return nil, fmt.Errorf("error preparing query ClearItemProjectRequirementByProjectID: %w", err)
}
if q.clearItemStatProgressStmt, err = db.PrepareContext(ctx, clearItemStatProgress); err != nil {
return nil, fmt.Errorf("error preparing query ClearItemStatProgress: %w", err)
}
if q.deleteAllProjectRequirementStatsStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirementStats); err != nil {
return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirementStats: %w", err)
}
if q.deleteAllProjectRequirementStatsByStatStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirementStatsByStat); err != nil {
return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirementStatsByStat: %w", err)
}
if q.deleteAllProjectRequirementsStmt, err = db.PrepareContext(ctx, deleteAllProjectRequirements); err != nil {
return nil, fmt.Errorf("error preparing query DeleteAllProjectRequirements: %w", err)
}
if q.deleteAllScopeMembersStmt, err = db.PrepareContext(ctx, deleteAllScopeMembers); err != nil {
return nil, fmt.Errorf("error preparing query DeleteAllScopeMembers: %w", err)
}
if q.deleteItemStmt, err = db.PrepareContext(ctx, deleteItem); err != nil {
return nil, fmt.Errorf("error preparing query DeleteItem: %w", err)
}
if q.deleteItemForRequirementStmt, err = db.PrepareContext(ctx, deleteItemForRequirement); err != nil {
return nil, fmt.Errorf("error preparing query DeleteItemForRequirement: %w", err)
}
if q.deleteItemStatProgressStmt, err = db.PrepareContext(ctx, deleteItemStatProgress); err != nil {
return nil, fmt.Errorf("error preparing query DeleteItemStatProgress: %w", err)
}
if q.deleteProjectStmt, err = db.PrepareContext(ctx, deleteProject); err != nil {
return nil, fmt.Errorf("error preparing query DeleteProject: %w", err)
}
if q.deleteProjectRequirementStmt, err = db.PrepareContext(ctx, deleteProjectRequirement); err != nil {
return nil, fmt.Errorf("error preparing query DeleteProjectRequirement: %w", err)
}
if q.deleteProjectRequirementStatStmt, err = db.PrepareContext(ctx, deleteProjectRequirementStat); err != nil {
return nil, fmt.Errorf("error preparing query DeleteProjectRequirementStat: %w", err)
}
if q.deleteScopeStmt, err = db.PrepareContext(ctx, deleteScope); err != nil {
return nil, fmt.Errorf("error preparing query DeleteScope: %w", err)
}
if q.deleteScopeMemberStmt, err = db.PrepareContext(ctx, deleteScopeMember); err != nil {
return nil, fmt.Errorf("error preparing query DeleteScopeMember: %w", err)
}
if q.deleteStatStmt, err = db.PrepareContext(ctx, deleteStat); err != nil {
return nil, fmt.Errorf("error preparing query DeleteStat: %w", err)
}
if q.getItemStmt, err = db.PrepareContext(ctx, getItem); err != nil {
return nil, fmt.Errorf("error preparing query GetItem: %w", err)
}
if q.getItemStatProgressBetweenStmt, err = db.PrepareContext(ctx, getItemStatProgressBetween); err != nil {
return nil, fmt.Errorf("error preparing query GetItemStatProgressBetween: %w", err)
}
if q.getProjectStmt, err = db.PrepareContext(ctx, getProject); err != nil {
return nil, fmt.Errorf("error preparing query GetProject: %w", err)
}
if q.getProjectRequirementStmt, err = db.PrepareContext(ctx, getProjectRequirement); err != nil {
return nil, fmt.Errorf("error preparing query GetProjectRequirement: %w", err)
}
if q.getScopeStmt, err = db.PrepareContext(ctx, getScope); err != nil {
return nil, fmt.Errorf("error preparing query GetScope: %w", err)
}
if q.getScopeDisplayNameStmt, err = db.PrepareContext(ctx, getScopeDisplayName); err != nil {
return nil, fmt.Errorf("error preparing query GetScopeDisplayName: %w", err)
}
if q.getScopeWithDisplayNameStmt, err = db.PrepareContext(ctx, getScopeWithDisplayName); err != nil {
return nil, fmt.Errorf("error preparing query GetScopeWithDisplayName: %w", err)
}
if q.getStatStmt, err = db.PrepareContext(ctx, getStat); err != nil {
return nil, fmt.Errorf("error preparing query GetStat: %w", err)
}
if q.insertItemStmt, err = db.PrepareContext(ctx, insertItem); err != nil {
return nil, fmt.Errorf("error preparing query InsertItem: %w", err)
}
if q.insertProjectStmt, err = db.PrepareContext(ctx, insertProject); err != nil {
return nil, fmt.Errorf("error preparing query InsertProject: %w", err)
}
if q.insertProjectRequirementStmt, err = db.PrepareContext(ctx, insertProjectRequirement); err != nil {
return nil, fmt.Errorf("error preparing query InsertProjectRequirement: %w", err)
}
if q.insertScopeStmt, err = db.PrepareContext(ctx, insertScope); err != nil {
return nil, fmt.Errorf("error preparing query InsertScope: %w", err)
}
if q.insertStatStmt, err = db.PrepareContext(ctx, insertStat); err != nil {
return nil, fmt.Errorf("error preparing query InsertStat: %w", err)
}
if q.listItemStatProgressStmt, err = db.PrepareContext(ctx, listItemStatProgress); err != nil {
return nil, fmt.Errorf("error preparing query ListItemStatProgress: %w", err)
}
if q.listItemStatProgressMultiStmt, err = db.PrepareContext(ctx, listItemStatProgressMulti); err != nil {
return nil, fmt.Errorf("error preparing query ListItemStatProgressMulti: %w", err)
}
if q.listItemsAcquiredBetweenStmt, err = db.PrepareContext(ctx, listItemsAcquiredBetween); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsAcquiredBetween: %w", err)
}
if q.listItemsByProjectStmt, err = db.PrepareContext(ctx, listItemsByProject); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsByProject: %w", err)
}
if q.listItemsCreatedBetweenStmt, err = db.PrepareContext(ctx, listItemsCreatedBetween); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsCreatedBetween: %w", err)
}
if q.listItemsCreatedBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsCreatedBetweenNoScope); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsCreatedBetweenNoScope: %w", err)
}
if q.listItemsLooseBetweenStmt, err = db.PrepareContext(ctx, listItemsLooseBetween); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsLooseBetween: %w", err)
}
if q.listItemsLooseBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsLooseBetweenNoScope); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsLooseBetweenNoScope: %w", err)
}
if q.listItemsScheduledBetweenStmt, err = db.PrepareContext(ctx, listItemsScheduledBetween); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsScheduledBetween: %w", err)
}
if q.listItemsScheduledBetweenNoScopeStmt, err = db.PrepareContext(ctx, listItemsScheduledBetweenNoScope); err != nil {
return nil, fmt.Errorf("error preparing query ListItemsScheduledBetweenNoScope: %w", err)
}
if q.listProjectEntriesStmt, err = db.PrepareContext(ctx, listProjectEntries); err != nil {
return nil, fmt.Errorf("error preparing query ListProjectEntries: %w", err)
}
if q.listProjectRequirementStatsStmt, err = db.PrepareContext(ctx, listProjectRequirementStats); err != nil {
return nil, fmt.Errorf("error preparing query ListProjectRequirementStats: %w", err)
}
if q.listProjectRequirementsByProjectIDStmt, err = db.PrepareContext(ctx, listProjectRequirementsByProjectID); err != nil {
return nil, fmt.Errorf("error preparing query ListProjectRequirementsByProjectID: %w", err)
}
if q.listScopeMembersStmt, err = db.PrepareContext(ctx, listScopeMembers); err != nil {
return nil, fmt.Errorf("error preparing query ListScopeMembers: %w", err)
}
if q.listScopesStmt, err = db.PrepareContext(ctx, listScopes); err != nil {
return nil, fmt.Errorf("error preparing query ListScopes: %w", err)
}
if q.listScopesByUserStmt, err = db.PrepareContext(ctx, listScopesByUser); err != nil {
return nil, fmt.Errorf("error preparing query ListScopesByUser: %w", err)
}
if q.listStatsStmt, err = db.PrepareContext(ctx, listStats); err != nil {
return nil, fmt.Errorf("error preparing query ListStats: %w", err)
}
if q.replaceItemStatProgressStmt, err = db.PrepareContext(ctx, replaceItemStatProgress); err != nil {
return nil, fmt.Errorf("error preparing query ReplaceItemStatProgress: %w", err)
}
if q.replaceProjectRequirementStatStmt, err = db.PrepareContext(ctx, replaceProjectRequirementStat); err != nil {
return nil, fmt.Errorf("error preparing query ReplaceProjectRequirementStat: %w", err)
}
if q.updateItemStmt, err = db.PrepareContext(ctx, updateItem); err != nil {
return nil, fmt.Errorf("error preparing query UpdateItem: %w", err)
}
if q.updateProjectStmt, err = db.PrepareContext(ctx, updateProject); err != nil {
return nil, fmt.Errorf("error preparing query UpdateProject: %w", err)
}
if q.updateProjectRequirementStmt, err = db.PrepareContext(ctx, updateProjectRequirement); err != nil {
return nil, fmt.Errorf("error preparing query UpdateProjectRequirement: %w", err)
}
if q.updateScopeStmt, err = db.PrepareContext(ctx, updateScope); err != nil {
return nil, fmt.Errorf("error preparing query UpdateScope: %w", err)
}
if q.updateScopeMemberStmt, err = db.PrepareContext(ctx, updateScopeMember); err != nil {
return nil, fmt.Errorf("error preparing query UpdateScopeMember: %w", err)
}
if q.updateStatStmt, err = db.PrepareContext(ctx, updateStat); err != nil {
return nil, fmt.Errorf("error preparing query UpdateStat: %w", err)
}
return &q, nil
}
func (q *Queries) Close() error {
var err error
if q.cLearItemStatProgressByStatStmt != nil {
if cerr := q.cLearItemStatProgressByStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing cLearItemStatProgressByStatStmt: %w", cerr)
}
}
if q.clearItemProjectRequirementStmt != nil {
if cerr := q.clearItemProjectRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing clearItemProjectRequirementStmt: %w", cerr)
}
}
if q.clearItemProjectRequirementByProjectIDStmt != nil {
if cerr := q.clearItemProjectRequirementByProjectIDStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing clearItemProjectRequirementByProjectIDStmt: %w", cerr)
}
}
if q.clearItemStatProgressStmt != nil {
if cerr := q.clearItemStatProgressStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing clearItemStatProgressStmt: %w", cerr)
}
}
if q.deleteAllProjectRequirementStatsStmt != nil {
if cerr := q.deleteAllProjectRequirementStatsStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteAllProjectRequirementStatsStmt: %w", cerr)
}
}
if q.deleteAllProjectRequirementStatsByStatStmt != nil {
if cerr := q.deleteAllProjectRequirementStatsByStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteAllProjectRequirementStatsByStatStmt: %w", cerr)
}
}
if q.deleteAllProjectRequirementsStmt != nil {
if cerr := q.deleteAllProjectRequirementsStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteAllProjectRequirementsStmt: %w", cerr)
}
}
if q.deleteAllScopeMembersStmt != nil {
if cerr := q.deleteAllScopeMembersStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteAllScopeMembersStmt: %w", cerr)
}
}
if q.deleteItemStmt != nil {
if cerr := q.deleteItemStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteItemStmt: %w", cerr)
}
}
if q.deleteItemForRequirementStmt != nil {
if cerr := q.deleteItemForRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteItemForRequirementStmt: %w", cerr)
}
}
if q.deleteItemStatProgressStmt != nil {
if cerr := q.deleteItemStatProgressStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteItemStatProgressStmt: %w", cerr)
}
}
if q.deleteProjectStmt != nil {
if cerr := q.deleteProjectStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteProjectStmt: %w", cerr)
}
}
if q.deleteProjectRequirementStmt != nil {
if cerr := q.deleteProjectRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteProjectRequirementStmt: %w", cerr)
}
}
if q.deleteProjectRequirementStatStmt != nil {
if cerr := q.deleteProjectRequirementStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteProjectRequirementStatStmt: %w", cerr)
}
}
if q.deleteScopeStmt != nil {
if cerr := q.deleteScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteScopeStmt: %w", cerr)
}
}
if q.deleteScopeMemberStmt != nil {
if cerr := q.deleteScopeMemberStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteScopeMemberStmt: %w", cerr)
}
}
if q.deleteStatStmt != nil {
if cerr := q.deleteStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing deleteStatStmt: %w", cerr)
}
}
if q.getItemStmt != nil {
if cerr := q.getItemStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getItemStmt: %w", cerr)
}
}
if q.getItemStatProgressBetweenStmt != nil {
if cerr := q.getItemStatProgressBetweenStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getItemStatProgressBetweenStmt: %w", cerr)
}
}
if q.getProjectStmt != nil {
if cerr := q.getProjectStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getProjectStmt: %w", cerr)
}
}
if q.getProjectRequirementStmt != nil {
if cerr := q.getProjectRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getProjectRequirementStmt: %w", cerr)
}
}
if q.getScopeStmt != nil {
if cerr := q.getScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getScopeStmt: %w", cerr)
}
}
if q.getScopeDisplayNameStmt != nil {
if cerr := q.getScopeDisplayNameStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getScopeDisplayNameStmt: %w", cerr)
}
}
if q.getScopeWithDisplayNameStmt != nil {
if cerr := q.getScopeWithDisplayNameStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getScopeWithDisplayNameStmt: %w", cerr)
}
}
if q.getStatStmt != nil {
if cerr := q.getStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing getStatStmt: %w", cerr)
}
}
if q.insertItemStmt != nil {
if cerr := q.insertItemStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing insertItemStmt: %w", cerr)
}
}
if q.insertProjectStmt != nil {
if cerr := q.insertProjectStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing insertProjectStmt: %w", cerr)
}
}
if q.insertProjectRequirementStmt != nil {
if cerr := q.insertProjectRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing insertProjectRequirementStmt: %w", cerr)
}
}
if q.insertScopeStmt != nil {
if cerr := q.insertScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing insertScopeStmt: %w", cerr)
}
}
if q.insertStatStmt != nil {
if cerr := q.insertStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing insertStatStmt: %w", cerr)
}
}
if q.listItemStatProgressStmt != nil {
if cerr := q.listItemStatProgressStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemStatProgressStmt: %w", cerr)
}
}
if q.listItemStatProgressMultiStmt != nil {
if cerr := q.listItemStatProgressMultiStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemStatProgressMultiStmt: %w", cerr)
}
}
if q.listItemsAcquiredBetweenStmt != nil {
if cerr := q.listItemsAcquiredBetweenStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsAcquiredBetweenStmt: %w", cerr)
}
}
if q.listItemsByProjectStmt != nil {
if cerr := q.listItemsByProjectStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsByProjectStmt: %w", cerr)
}
}
if q.listItemsCreatedBetweenStmt != nil {
if cerr := q.listItemsCreatedBetweenStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsCreatedBetweenStmt: %w", cerr)
}
}
if q.listItemsCreatedBetweenNoScopeStmt != nil {
if cerr := q.listItemsCreatedBetweenNoScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsCreatedBetweenNoScopeStmt: %w", cerr)
}
}
if q.listItemsLooseBetweenStmt != nil {
if cerr := q.listItemsLooseBetweenStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsLooseBetweenStmt: %w", cerr)
}
}
if q.listItemsLooseBetweenNoScopeStmt != nil {
if cerr := q.listItemsLooseBetweenNoScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsLooseBetweenNoScopeStmt: %w", cerr)
}
}
if q.listItemsScheduledBetweenStmt != nil {
if cerr := q.listItemsScheduledBetweenStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsScheduledBetweenStmt: %w", cerr)
}
}
if q.listItemsScheduledBetweenNoScopeStmt != nil {
if cerr := q.listItemsScheduledBetweenNoScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listItemsScheduledBetweenNoScopeStmt: %w", cerr)
}
}
if q.listProjectEntriesStmt != nil {
if cerr := q.listProjectEntriesStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listProjectEntriesStmt: %w", cerr)
}
}
if q.listProjectRequirementStatsStmt != nil {
if cerr := q.listProjectRequirementStatsStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listProjectRequirementStatsStmt: %w", cerr)
}
}
if q.listProjectRequirementsByProjectIDStmt != nil {
if cerr := q.listProjectRequirementsByProjectIDStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listProjectRequirementsByProjectIDStmt: %w", cerr)
}
}
if q.listScopeMembersStmt != nil {
if cerr := q.listScopeMembersStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listScopeMembersStmt: %w", cerr)
}
}
if q.listScopesStmt != nil {
if cerr := q.listScopesStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listScopesStmt: %w", cerr)
}
}
if q.listScopesByUserStmt != nil {
if cerr := q.listScopesByUserStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listScopesByUserStmt: %w", cerr)
}
}
if q.listStatsStmt != nil {
if cerr := q.listStatsStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing listStatsStmt: %w", cerr)
}
}
if q.replaceItemStatProgressStmt != nil {
if cerr := q.replaceItemStatProgressStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing replaceItemStatProgressStmt: %w", cerr)
}
}
if q.replaceProjectRequirementStatStmt != nil {
if cerr := q.replaceProjectRequirementStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing replaceProjectRequirementStatStmt: %w", cerr)
}
}
if q.updateItemStmt != nil {
if cerr := q.updateItemStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateItemStmt: %w", cerr)
}
}
if q.updateProjectStmt != nil {
if cerr := q.updateProjectStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateProjectStmt: %w", cerr)
}
}
if q.updateProjectRequirementStmt != nil {
if cerr := q.updateProjectRequirementStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateProjectRequirementStmt: %w", cerr)
}
}
if q.updateScopeStmt != nil {
if cerr := q.updateScopeStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateScopeStmt: %w", cerr)
}
}
if q.updateScopeMemberStmt != nil {
if cerr := q.updateScopeMemberStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateScopeMemberStmt: %w", cerr)
}
}
if q.updateStatStmt != nil {
if cerr := q.updateStatStmt.Close(); cerr != nil {
err = fmt.Errorf("error closing updateStatStmt: %w", cerr)
}
}
return err
}
func (q *Queries) exec(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) (sql.Result, error) {
switch {
case stmt != nil && q.tx != nil:
return q.tx.StmtContext(ctx, stmt).ExecContext(ctx, args...)
case stmt != nil:
return stmt.ExecContext(ctx, args...)
default:
return q.db.ExecContext(ctx, query, args...)
}
}
func (q *Queries) query(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) (*sql.Rows, error) {
switch {
case stmt != nil && q.tx != nil:
return q.tx.StmtContext(ctx, stmt).QueryContext(ctx, args...)
case stmt != nil:
return stmt.QueryContext(ctx, args...)
default:
return q.db.QueryContext(ctx, query, args...)
}
}
func (q *Queries) queryRow(ctx context.Context, stmt *sql.Stmt, query string, args ...interface{}) *sql.Row {
switch {
case stmt != nil && q.tx != nil:
return q.tx.StmtContext(ctx, stmt).QueryRowContext(ctx, args...)
case stmt != nil:
return stmt.QueryRowContext(ctx, args...)
default:
return q.db.QueryRowContext(ctx, query, args...)
}
}
type Queries struct {
db DBTX
tx *sql.Tx
cLearItemStatProgressByStatStmt *sql.Stmt
clearItemProjectRequirementStmt *sql.Stmt
clearItemProjectRequirementByProjectIDStmt *sql.Stmt
clearItemStatProgressStmt *sql.Stmt
deleteAllProjectRequirementStatsStmt *sql.Stmt
deleteAllProjectRequirementStatsByStatStmt *sql.Stmt
deleteAllProjectRequirementsStmt *sql.Stmt
deleteAllScopeMembersStmt *sql.Stmt
deleteItemStmt *sql.Stmt
deleteItemForRequirementStmt *sql.Stmt
deleteItemStatProgressStmt *sql.Stmt
deleteProjectStmt *sql.Stmt
deleteProjectRequirementStmt *sql.Stmt
deleteProjectRequirementStatStmt *sql.Stmt
deleteScopeStmt *sql.Stmt
deleteScopeMemberStmt *sql.Stmt
deleteStatStmt *sql.Stmt
getItemStmt *sql.Stmt
getItemStatProgressBetweenStmt *sql.Stmt
getProjectStmt *sql.Stmt
getProjectRequirementStmt *sql.Stmt
getScopeStmt *sql.Stmt
getScopeDisplayNameStmt *sql.Stmt
getScopeWithDisplayNameStmt *sql.Stmt
getStatStmt *sql.Stmt
insertItemStmt *sql.Stmt
insertProjectStmt *sql.Stmt
insertProjectRequirementStmt *sql.Stmt
insertScopeStmt *sql.Stmt
insertStatStmt *sql.Stmt
listItemStatProgressStmt *sql.Stmt
listItemStatProgressMultiStmt *sql.Stmt
listItemsAcquiredBetweenStmt *sql.Stmt
listItemsByProjectStmt *sql.Stmt
listItemsCreatedBetweenStmt *sql.Stmt
listItemsCreatedBetweenNoScopeStmt *sql.Stmt
listItemsLooseBetweenStmt *sql.Stmt
listItemsLooseBetweenNoScopeStmt *sql.Stmt
listItemsScheduledBetweenStmt *sql.Stmt
listItemsScheduledBetweenNoScopeStmt *sql.Stmt
listProjectEntriesStmt *sql.Stmt
listProjectRequirementStatsStmt *sql.Stmt
listProjectRequirementsByProjectIDStmt *sql.Stmt
listScopeMembersStmt *sql.Stmt
listScopesStmt *sql.Stmt
listScopesByUserStmt *sql.Stmt
listStatsStmt *sql.Stmt
replaceItemStatProgressStmt *sql.Stmt
replaceProjectRequirementStatStmt *sql.Stmt
updateItemStmt *sql.Stmt
updateProjectStmt *sql.Stmt
updateProjectRequirementStmt *sql.Stmt
updateScopeStmt *sql.Stmt
updateScopeMemberStmt *sql.Stmt
updateStatStmt *sql.Stmt
}
func (q *Queries) WithTx(tx *sql.Tx) *Queries {
return &Queries{
db: tx,
tx: tx,
cLearItemStatProgressByStatStmt: q.cLearItemStatProgressByStatStmt,
clearItemProjectRequirementStmt: q.clearItemProjectRequirementStmt,
clearItemProjectRequirementByProjectIDStmt: q.clearItemProjectRequirementByProjectIDStmt,
clearItemStatProgressStmt: q.clearItemStatProgressStmt,
deleteAllProjectRequirementStatsStmt: q.deleteAllProjectRequirementStatsStmt,
deleteAllProjectRequirementStatsByStatStmt: q.deleteAllProjectRequirementStatsByStatStmt,
deleteAllProjectRequirementsStmt: q.deleteAllProjectRequirementsStmt,
deleteAllScopeMembersStmt: q.deleteAllScopeMembersStmt,
deleteItemStmt: q.deleteItemStmt,
deleteItemForRequirementStmt: q.deleteItemForRequirementStmt,
deleteItemStatProgressStmt: q.deleteItemStatProgressStmt,
deleteProjectStmt: q.deleteProjectStmt,
deleteProjectRequirementStmt: q.deleteProjectRequirementStmt,
deleteProjectRequirementStatStmt: q.deleteProjectRequirementStatStmt,
deleteScopeStmt: q.deleteScopeStmt,
deleteScopeMemberStmt: q.deleteScopeMemberStmt,
deleteStatStmt: q.deleteStatStmt,
getItemStmt: q.getItemStmt,
getItemStatProgressBetweenStmt: q.getItemStatProgressBetweenStmt,
getProjectStmt: q.getProjectStmt,
getProjectRequirementStmt: q.getProjectRequirementStmt,
getScopeStmt: q.getScopeStmt,
getScopeDisplayNameStmt: q.getScopeDisplayNameStmt,
getScopeWithDisplayNameStmt: q.getScopeWithDisplayNameStmt,
getStatStmt: q.getStatStmt,
insertItemStmt: q.insertItemStmt,
insertProjectStmt: q.insertProjectStmt,
insertProjectRequirementStmt: q.insertProjectRequirementStmt,
insertScopeStmt: q.insertScopeStmt,
insertStatStmt: q.insertStatStmt,
listItemStatProgressStmt: q.listItemStatProgressStmt,
listItemStatProgressMultiStmt: q.listItemStatProgressMultiStmt,
listItemsAcquiredBetweenStmt: q.listItemsAcquiredBetweenStmt,
listItemsByProjectStmt: q.listItemsByProjectStmt,
listItemsCreatedBetweenStmt: q.listItemsCreatedBetweenStmt,
listItemsCreatedBetweenNoScopeStmt: q.listItemsCreatedBetweenNoScopeStmt,
listItemsLooseBetweenStmt: q.listItemsLooseBetweenStmt,
listItemsLooseBetweenNoScopeStmt: q.listItemsLooseBetweenNoScopeStmt,
listItemsScheduledBetweenStmt: q.listItemsScheduledBetweenStmt,
listItemsScheduledBetweenNoScopeStmt: q.listItemsScheduledBetweenNoScopeStmt,
listProjectEntriesStmt: q.listProjectEntriesStmt,
listProjectRequirementStatsStmt: q.listProjectRequirementStatsStmt,
listProjectRequirementsByProjectIDStmt: q.listProjectRequirementsByProjectIDStmt,
listScopeMembersStmt: q.listScopeMembersStmt,
listScopesStmt: q.listScopesStmt,
listScopesByUserStmt: q.listScopesByUserStmt,
listStatsStmt: q.listStatsStmt,
replaceItemStatProgressStmt: q.replaceItemStatProgressStmt,
replaceProjectRequirementStatStmt: q.replaceProjectRequirementStatStmt,
updateItemStmt: q.updateItemStmt,
updateProjectStmt: q.updateProjectStmt,
updateProjectRequirementStmt: q.updateProjectRequirementStmt,
updateScopeStmt: q.updateScopeStmt,
updateScopeMemberStmt: q.updateScopeMemberStmt,
updateStatStmt: q.updateStatStmt,
}
}