Documentation ¶
Index ¶
- Variables
- func AddAnswerHook(hookPoint boil.HookPoint, answerHook AnswerHook)
- func AddChoiceHook(hookPoint boil.HookPoint, choiceHook ChoiceHook)
- func AddQuestionHook(hookPoint boil.HookPoint, questionHook QuestionHook)
- func AnswerExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Answers(mods ...qm.QueryMod) answerQuery
- func ChoiceExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Choices(mods ...qm.QueryMod) choiceQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func QuestionExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Questions(mods ...qm.QueryMod) questionQuery
- type Answer
- func (o *Answer) Choice(mods ...qm.QueryMod) choiceQuery
- func (o *Answer) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Answer) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Answer) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Answer) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Answer) SetChoice(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Choice) error
- func (o *Answer) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Answer) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type AnswerHook
- type AnswerSlice
- type Choice
- func (o *Choice) AddAnswers(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Choice) Answers(mods ...qm.QueryMod) answerQuery
- func (o *Choice) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Choice) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Choice) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Choice) Question(mods ...qm.QueryMod) questionQuery
- func (o *Choice) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Choice) SetQuestion(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Question) error
- func (o *Choice) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Choice) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type ChoiceHook
- type ChoiceSlice
- type M
- type Question
- func (o *Question) AddChoices(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Question) Choices(mods ...qm.QueryMod) choiceQuery
- func (o *Question) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Question) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Question) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Question) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Question) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Question) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type QuestionHook
- type QuestionSlice
- type UpsertOptionFunc
- type UpsertOptions
Constants ¶
This section is empty.
Variables ¶
var AnswerColumns = struct { ID string UserID string ChoiceID string CreatedAt string }{ ID: "id", UserID: "user_id", ChoiceID: "choice_id", CreatedAt: "created_at", }
var AnswerRels = struct { Choice string }{ Choice: "Choice", }
AnswerRels is where relationship names are stored.
var AnswerTableColumns = struct { ID string UserID string ChoiceID string CreatedAt string }{ ID: "answers.id", UserID: "answers.user_id", ChoiceID: "answers.choice_id", CreatedAt: "answers.created_at", }
var AnswerWhere = struct { ID whereHelperstring UserID whereHelperstring ChoiceID whereHelperstring CreatedAt whereHelpertime_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, UserID: whereHelperstring{/* contains filtered or unexported fields */}, ChoiceID: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ChoiceColumns = struct { ID string QuestionID string Choice string IsCorrect string CreatedAt string }{ ID: "id", QuestionID: "question_id", Choice: "choice", IsCorrect: "is_correct", CreatedAt: "created_at", }
var ChoiceRels = struct { Question string Answers string }{ Question: "Question", Answers: "Answers", }
ChoiceRels is where relationship names are stored.
var ChoiceTableColumns = struct { ID string QuestionID string Choice string IsCorrect string CreatedAt string }{ ID: "choices.id", QuestionID: "choices.question_id", Choice: "choices.choice", IsCorrect: "choices.is_correct", CreatedAt: "choices.created_at", }
var ChoiceWhere = struct { ID whereHelperstring QuestionID whereHelperstring Choice whereHelperstring IsCorrect whereHelperbool CreatedAt whereHelpertime_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, QuestionID: whereHelperstring{/* contains filtered or unexported fields */}, Choice: whereHelperstring{/* contains filtered or unexported fields */}, IsCorrect: whereHelperbool{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")
ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.
var QuestionColumns = struct { ID string Question string Hint string CreatedAt string Difficulty string Topic string MoreInfo string }{ ID: "id", Question: "question", Hint: "hint", CreatedAt: "created_at", Difficulty: "difficulty", Topic: "topic", MoreInfo: "more_info", }
var QuestionRels = struct { Choices string }{ Choices: "Choices", }
QuestionRels is where relationship names are stored.
var QuestionTableColumns = struct { ID string Question string Hint string CreatedAt string Difficulty string Topic string MoreInfo string }{ ID: "questions.id", Question: "questions.question", Hint: "questions.hint", CreatedAt: "questions.created_at", Difficulty: "questions.difficulty", Topic: "questions.topic", MoreInfo: "questions.more_info", }
var QuestionWhere = struct { ID whereHelperstring Question whereHelperstring Hint whereHelperstring CreatedAt whereHelpertime_Time Difficulty whereHelperstring Topic whereHelperstring MoreInfo whereHelperstring }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, Question: whereHelperstring{/* contains filtered or unexported fields */}, Hint: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, Difficulty: whereHelperstring{/* contains filtered or unexported fields */}, Topic: whereHelperstring{/* contains filtered or unexported fields */}, MoreInfo: whereHelperstring{/* contains filtered or unexported fields */}, }
var TableNames = struct { Answers string Choices string Questions string }{ Answers: "answers", Choices: "choices", Questions: "questions", }
var ViewNames = struct {
}{}
Functions ¶
func AddAnswerHook ¶
func AddAnswerHook(hookPoint boil.HookPoint, answerHook AnswerHook)
AddAnswerHook registers your hook function for all future operations.
func AddChoiceHook ¶
func AddChoiceHook(hookPoint boil.HookPoint, choiceHook ChoiceHook)
AddChoiceHook registers your hook function for all future operations.
func AddQuestionHook ¶
func AddQuestionHook(hookPoint boil.HookPoint, questionHook QuestionHook)
AddQuestionHook registers your hook function for all future operations.
func AnswerExists ¶
AnswerExists checks if the Answer row exists.
func ChoiceExists ¶
ChoiceExists checks if the Choice row exists.
func QuestionExists ¶
QuestionExists checks if the Question row exists.
Types ¶
type Answer ¶
type Answer struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` UserID string `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"` ChoiceID string `boil:"choice_id" json:"choice_id" toml:"choice_id" yaml:"choice_id"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` R *answerR `boil:"" json:"" toml:"" yaml:""` L answerL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Answer is an object representing the database table.
func FindAnswer ¶
func FindAnswer(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Answer, error)
FindAnswer retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Answer) Delete ¶
Delete deletes a single Answer record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Answer) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Answer) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Answer) SetChoice ¶
func (o *Answer) SetChoice(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Choice) error
SetChoice of the answer to the related item. Sets o.R.Choice to related. Adds o to related.R.Answers.
func (*Answer) Update ¶
func (o *Answer) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Answer. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Answer) Upsert ¶
func (o *Answer) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type AnswerHook ¶
AnswerHook is the signature for custom Answer hook methods
type AnswerSlice ¶
type AnswerSlice []*Answer
AnswerSlice is an alias for a slice of pointers to Answer. This should almost always be used instead of []Answer.
func (AnswerSlice) DeleteAll ¶
func (o AnswerSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*AnswerSlice) ReloadAll ¶
func (o *AnswerSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (AnswerSlice) UpdateAll ¶
func (o AnswerSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type Choice ¶
type Choice struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` QuestionID string `boil:"question_id" json:"question_id" toml:"question_id" yaml:"question_id"` Choice string `boil:"choice" json:"choice" toml:"choice" yaml:"choice"` IsCorrect bool `boil:"is_correct" json:"is_correct" toml:"is_correct" yaml:"is_correct"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` R *choiceR `boil:"" json:"" toml:"" yaml:""` L choiceL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Choice is an object representing the database table.
func FindChoice ¶
func FindChoice(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Choice, error)
FindChoice retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Choice) AddAnswers ¶
func (o *Choice) AddAnswers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Answer) error
AddAnswers adds the given related objects to the existing relationships of the choice, optionally inserting them as new records. Appends related to o.R.Answers. Sets related.R.Choice appropriately.
func (*Choice) Delete ¶
Delete deletes a single Choice record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Choice) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Choice) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Choice) SetQuestion ¶
func (o *Choice) SetQuestion(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Question) error
SetQuestion of the choice to the related item. Sets o.R.Question to related. Adds o to related.R.Choices.
func (*Choice) Update ¶
func (o *Choice) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Choice. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Choice) Upsert ¶
func (o *Choice) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type ChoiceHook ¶
ChoiceHook is the signature for custom Choice hook methods
type ChoiceSlice ¶
type ChoiceSlice []*Choice
ChoiceSlice is an alias for a slice of pointers to Choice. This should almost always be used instead of []Choice.
func (ChoiceSlice) DeleteAll ¶
func (o ChoiceSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*ChoiceSlice) ReloadAll ¶
func (o *ChoiceSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (ChoiceSlice) UpdateAll ¶
func (o ChoiceSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type M ¶
type M map[string]interface{}
M type is for providing columns and column values to UpdateAll.
type Question ¶
type Question struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` Question string `boil:"question" json:"question" toml:"question" yaml:"question"` Hint string `boil:"hint" json:"hint" toml:"hint" yaml:"hint"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` Difficulty string `boil:"difficulty" json:"difficulty" toml:"difficulty" yaml:"difficulty"` Topic string `boil:"topic" json:"topic" toml:"topic" yaml:"topic"` MoreInfo string `boil:"more_info" json:"more_info" toml:"more_info" yaml:"more_info"` R *questionR `boil:"" json:"" toml:"" yaml:""` L questionL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Question is an object representing the database table.
func FindQuestion ¶
func FindQuestion(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Question, error)
FindQuestion retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Question) AddChoices ¶
func (o *Question) AddChoices(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Choice) error
AddChoices adds the given related objects to the existing relationships of the question, optionally inserting them as new records. Appends related to o.R.Choices. Sets related.R.Question appropriately.
func (*Question) Delete ¶
Delete deletes a single Question record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Question) Insert ¶
func (o *Question) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Question) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Question) Update ¶
func (o *Question) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Question. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Question) Upsert ¶
func (o *Question) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns, opts ...UpsertOptionFunc) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.
type QuestionHook ¶
QuestionHook is the signature for custom Question hook methods
type QuestionSlice ¶
type QuestionSlice []*Question
QuestionSlice is an alias for a slice of pointers to Question. This should almost always be used instead of []Question.
func (QuestionSlice) DeleteAll ¶
func (o QuestionSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*QuestionSlice) ReloadAll ¶
func (o *QuestionSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (QuestionSlice) UpdateAll ¶
func (o QuestionSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
UpdateAll updates all rows with the specified column values, using an executor.
type UpsertOptionFunc ¶
type UpsertOptionFunc func(o *UpsertOptions)
func UpsertConflictTarget ¶
func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc
func UpsertUpdateSet ¶
func UpsertUpdateSet(updateSet string) UpsertOptionFunc
type UpsertOptions ¶
type UpsertOptions struct {
// contains filtered or unexported fields
}