models

package
v0.0.0-...-59b6e81 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnswerColumns = struct {
	ID         string
	QuestionID string
	CreatedBy  string
	CreatedAt  string
	Answered   string
	Answer     string
}{
	ID:         "id",
	QuestionID: "question_id",
	CreatedBy:  "created_by",
	CreatedAt:  "created_at",
	Answered:   "answered",
	Answer:     "answer",
}
View Source
var AnswerRels = struct {
	CreatedByUser string
	Question      string
}{
	CreatedByUser: "CreatedByUser",
	Question:      "Question",
}

AnswerRels is where relationship names are stored.

View Source
var AnswerWhere = struct {
	ID         whereHelperstring
	QuestionID whereHelperstring
	CreatedBy  whereHelperstring
	CreatedAt  whereHelpernull_Time
	Answered   whereHelpernull_Bool
	Answer     whereHelperstring
}{
	ID:         whereHelperstring{/* contains filtered or unexported fields */},
	QuestionID: whereHelperstring{/* contains filtered or unexported fields */},
	CreatedBy:  whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelpernull_Time{/* contains filtered or unexported fields */},
	Answered:   whereHelpernull_Bool{/* contains filtered or unexported fields */},
	Answer:     whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
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.

View Source
var QuestionColumns = struct {
	ID          string
	Title       string
	Description string
	CreatedBy   string
	CreatedAt   string
	Status      string
}{
	ID:          "id",
	Title:       "title",
	Description: "description",
	CreatedBy:   "created_by",
	CreatedAt:   "created_at",
	Status:      "status",
}
View Source
var QuestionRels = struct {
	CreatedByUser string
	Answers       string
}{
	CreatedByUser: "CreatedByUser",
	Answers:       "Answers",
}

QuestionRels is where relationship names are stored.

View Source
var QuestionWhere = struct {
	ID          whereHelperstring
	Title       whereHelperstring
	Description whereHelperstring
	CreatedBy   whereHelperstring
	CreatedAt   whereHelpernull_Time
	Status      whereHelpernull_String
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	Title:       whereHelperstring{/* contains filtered or unexported fields */},
	Description: whereHelperstring{/* contains filtered or unexported fields */},
	CreatedBy:   whereHelperstring{/* contains filtered or unexported fields */},
	CreatedAt:   whereHelpernull_Time{/* contains filtered or unexported fields */},
	Status:      whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var RatingColumns = struct {
	ID       string
	Kind     string
	RecordID string
	RatedBy  string
	RatedAt  string
	Value    string
}{
	ID:       "id",
	Kind:     "kind",
	RecordID: "record_id",
	RatedBy:  "rated_by",
	RatedAt:  "rated_at",
	Value:    "value",
}
View Source
var RatingRels = struct {
	RatedByUser string
}{
	RatedByUser: "RatedByUser",
}

RatingRels is where relationship names are stored.

View Source
var RatingWhere = struct {
	ID       whereHelperstring
	Kind     whereHelperstring
	RecordID whereHelperstring
	RatedBy  whereHelperstring
	RatedAt  whereHelpertime_Time
	Value    whereHelperint16
}{
	ID:       whereHelperstring{/* contains filtered or unexported fields */},
	Kind:     whereHelperstring{/* contains filtered or unexported fields */},
	RecordID: whereHelperstring{/* contains filtered or unexported fields */},
	RatedBy:  whereHelperstring{/* contains filtered or unexported fields */},
	RatedAt:  whereHelpertime_Time{/* contains filtered or unexported fields */},
	Value:    whereHelperint16{/* contains filtered or unexported fields */},
}
View Source
var RevokeTokenColumns = struct {
	ID      string
	OwnerID string
	Token   string
}{
	ID:      "id",
	OwnerID: "owner_id",
	Token:   "token",
}
View Source
var RevokeTokenRels = struct {
	Owner string
}{
	Owner: "Owner",
}

RevokeTokenRels is where relationship names are stored.

View Source
var RevokeTokenWhere = struct {
	ID      whereHelperstring
	OwnerID whereHelperstring
	Token   whereHelperstring
}{
	ID:      whereHelperstring{/* contains filtered or unexported fields */},
	OwnerID: whereHelperstring{/* contains filtered or unexported fields */},
	Token:   whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Answers      string
	Questions    string
	Ratings      string
	RevokeTokens string
	Users        string
}{
	Answers:      "answers",
	Questions:    "questions",
	Ratings:      "ratings",
	RevokeTokens: "revoke_tokens",
	Users:        "users",
}
View Source
var UserColumns = struct {
	ID          string
	Username    string
	Password    string
	FullName    string
	AccessToken string
}{
	ID:          "id",
	Username:    "username",
	Password:    "password",
	FullName:    "full_name",
	AccessToken: "access_token",
}
View Source
var UserRels = struct {
	CreatedByAnswers   string
	CreatedByQuestions string
	RatedByRatings     string
	OwnerRevokeTokens  string
}{
	CreatedByAnswers:   "CreatedByAnswers",
	CreatedByQuestions: "CreatedByQuestions",
	RatedByRatings:     "RatedByRatings",
	OwnerRevokeTokens:  "OwnerRevokeTokens",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	ID          whereHelperstring
	Username    whereHelperstring
	Password    whereHelpernull_String
	FullName    whereHelpernull_String
	AccessToken whereHelpernull_String
}{
	ID:          whereHelperstring{/* contains filtered or unexported fields */},
	Username:    whereHelperstring{/* contains filtered or unexported fields */},
	Password:    whereHelpernull_String{/* contains filtered or unexported fields */},
	FullName:    whereHelpernull_String{/* contains filtered or unexported fields */},
	AccessToken: whereHelpernull_String{/* contains filtered or unexported fields */},
}

Functions

func AddAnswerHook

func AddAnswerHook(hookPoint boil.HookPoint, answerHook AnswerHook)

AddAnswerHook 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 AddRatingHook

func AddRatingHook(hookPoint boil.HookPoint, ratingHook RatingHook)

AddRatingHook registers your hook function for all future operations.

func AddRevokeTokenHook

func AddRevokeTokenHook(hookPoint boil.HookPoint, revokeTokenHook RevokeTokenHook)

AddRevokeTokenHook registers your hook function for all future operations.

func AddUserHook

func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)

AddUserHook registers your hook function for all future operations.

func AnswerExists

func AnswerExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

AnswerExists checks if the Answer row exists.

func Answers

func Answers(mods ...qm.QueryMod) answerQuery

Answers retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func QuestionExists

func QuestionExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

QuestionExists checks if the Question row exists.

func Questions

func Questions(mods ...qm.QueryMod) questionQuery

Questions retrieves all the records using an executor.

func RatingExists

func RatingExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

RatingExists checks if the Rating row exists.

func Ratings

func Ratings(mods ...qm.QueryMod) ratingQuery

Ratings retrieves all the records using an executor.

func RevokeTokenExists

func RevokeTokenExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

RevokeTokenExists checks if the RevokeToken row exists.

func RevokeTokens

func RevokeTokens(mods ...qm.QueryMod) revokeTokenQuery

RevokeTokens retrieves all the records using an executor.

func UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)

UserExists checks if the User row exists.

func Users

func Users(mods ...qm.QueryMod) userQuery

Users retrieves all the records using an executor.

Types

type Answer

type Answer 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"`
	CreatedBy  string    `boil:"created_by" json:"created_by" toml:"created_by" yaml:"created_by"`
	CreatedAt  null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	Answered   null.Bool `boil:"answered" json:"answered,omitempty" toml:"answered" yaml:"answered,omitempty"`
	Answer     string    `boil:"answer" json:"answer" toml:"answer" yaml:"answer"`

	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) CreatedByUser

func (o *Answer) CreatedByUser(mods ...qm.QueryMod) userQuery

CreatedByUser pointed to by the foreign key.

func (*Answer) Delete

func (o *Answer) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

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

func (o *Answer) 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 (*Answer) Question

func (o *Answer) Question(mods ...qm.QueryMod) questionQuery

Question pointed to by the foreign key.

func (*Answer) Reload

func (o *Answer) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Answer) SetCreatedByUser

func (o *Answer) SetCreatedByUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetCreatedByUser of the answer to the related item. Sets o.R.CreatedByUser to related. Adds o to related.R.CreatedByAnswers.

func (*Answer) SetQuestion

func (o *Answer) SetQuestion(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Question) error

SetQuestion of the answer to the related item. Sets o.R.Question 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) 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

type AnswerHook func(context.Context, boil.ContextExecutor, *Answer) error

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 generally be used opposed to []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 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"`
	Title       string      `boil:"title" json:"title" toml:"title" yaml:"title"`
	Description string      `boil:"description" json:"description" toml:"description" yaml:"description"`
	CreatedBy   string      `boil:"created_by" json:"created_by" toml:"created_by" yaml:"created_by"`
	CreatedAt   null.Time   `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	Status      null.String `boil:"status" json:"status,omitempty" toml:"status" yaml:"status,omitempty"`

	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) AddAnswers

func (o *Question) AddAnswers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Answer) error

AddAnswers adds the given related objects to the existing relationships of the question, optionally inserting them as new records. Appends related to o.R.Answers. Sets related.R.Question appropriately.

func (*Question) Answers

func (o *Question) Answers(mods ...qm.QueryMod) answerQuery

Answers retrieves all the answer's Answers with an executor.

func (*Question) CreatedByUser

func (o *Question) CreatedByUser(mods ...qm.QueryMod) userQuery

CreatedByUser pointed to by the foreign key.

func (*Question) Delete

func (o *Question) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

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

func (o *Question) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Question) SetCreatedByUser

func (o *Question) SetCreatedByUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetCreatedByUser of the question to the related item. Sets o.R.CreatedByUser to related. Adds o to related.R.CreatedByQuestions.

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) 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

type QuestionHook func(context.Context, boil.ContextExecutor, *Question) error

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 generally be used opposed to []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 Rating

type Rating struct {
	ID       string    `boil:"id" json:"id" toml:"id" yaml:"id"`
	Kind     string    `boil:"kind" json:"kind" toml:"kind" yaml:"kind"`
	RecordID string    `boil:"record_id" json:"record_id" toml:"record_id" yaml:"record_id"`
	RatedBy  string    `boil:"rated_by" json:"rated_by" toml:"rated_by" yaml:"rated_by"`
	RatedAt  time.Time `boil:"rated_at" json:"rated_at" toml:"rated_at" yaml:"rated_at"`
	Value    int16     `boil:"value" json:"value" toml:"value" yaml:"value"`

	R *ratingR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L ratingL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Rating is an object representing the database table.

func FindRating

func FindRating(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Rating, error)

FindRating retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Rating) Delete

func (o *Rating) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Rating record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Rating) Insert

func (o *Rating) 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 (*Rating) RatedByUser

func (o *Rating) RatedByUser(mods ...qm.QueryMod) userQuery

RatedByUser pointed to by the foreign key.

func (*Rating) Reload

func (o *Rating) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Rating) SetRatedByUser

func (o *Rating) SetRatedByUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetRatedByUser of the rating to the related item. Sets o.R.RatedByUser to related. Adds o to related.R.RatedByRatings.

func (*Rating) Update

func (o *Rating) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Rating. 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 (*Rating) Upsert

func (o *Rating) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) 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 RatingHook

type RatingHook func(context.Context, boil.ContextExecutor, *Rating) error

RatingHook is the signature for custom Rating hook methods

type RatingSlice

type RatingSlice []*Rating

RatingSlice is an alias for a slice of pointers to Rating. This should generally be used opposed to []Rating.

func (RatingSlice) DeleteAll

func (o RatingSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*RatingSlice) ReloadAll

func (o *RatingSlice) 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 (RatingSlice) UpdateAll

func (o RatingSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type RevokeToken

type RevokeToken struct {
	ID      string `boil:"id" json:"id" toml:"id" yaml:"id"`
	OwnerID string `boil:"owner_id" json:"owner_id" toml:"owner_id" yaml:"owner_id"`
	Token   string `boil:"token" json:"token" toml:"token" yaml:"token"`

	R *revokeTokenR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L revokeTokenL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

RevokeToken is an object representing the database table.

func FindRevokeToken

func FindRevokeToken(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*RevokeToken, error)

FindRevokeToken retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*RevokeToken) Delete

func (o *RevokeToken) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single RevokeToken record with an executor. Delete will match against the primary key column to find the record to delete.

func (*RevokeToken) Insert

func (o *RevokeToken) 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 (*RevokeToken) Owner

func (o *RevokeToken) Owner(mods ...qm.QueryMod) userQuery

Owner pointed to by the foreign key.

func (*RevokeToken) Reload

func (o *RevokeToken) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*RevokeToken) SetOwner

func (o *RevokeToken) SetOwner(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error

SetOwner of the revokeToken to the related item. Sets o.R.Owner to related. Adds o to related.R.OwnerRevokeTokens.

func (*RevokeToken) Update

func (o *RevokeToken) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the RevokeToken. 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 (*RevokeToken) Upsert

func (o *RevokeToken) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) 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 RevokeTokenHook

type RevokeTokenHook func(context.Context, boil.ContextExecutor, *RevokeToken) error

RevokeTokenHook is the signature for custom RevokeToken hook methods

type RevokeTokenSlice

type RevokeTokenSlice []*RevokeToken

RevokeTokenSlice is an alias for a slice of pointers to RevokeToken. This should generally be used opposed to []RevokeToken.

func (RevokeTokenSlice) DeleteAll

func (o RevokeTokenSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*RevokeTokenSlice) ReloadAll

func (o *RevokeTokenSlice) 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 (RevokeTokenSlice) UpdateAll

func (o RevokeTokenSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type User

type User struct {
	ID          string      `boil:"id" json:"id" toml:"id" yaml:"id"`
	Username    string      `boil:"username" json:"username" toml:"username" yaml:"username"`
	Password    null.String `boil:"password" json:"password,omitempty" toml:"password" yaml:"password,omitempty"`
	FullName    null.String `boil:"full_name" json:"full_name,omitempty" toml:"full_name" yaml:"full_name,omitempty"`
	AccessToken null.String `boil:"access_token" json:"access_token,omitempty" toml:"access_token" yaml:"access_token,omitempty"`

	R *userR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L userL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

User is an object representing the database table.

func FindUser

func FindUser(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*User, error)

FindUser retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*User) AddCreatedByAnswers

func (o *User) AddCreatedByAnswers(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Answer) error

AddCreatedByAnswers adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.CreatedByAnswers. Sets related.R.CreatedByUser appropriately.

func (*User) AddCreatedByQuestions

func (o *User) AddCreatedByQuestions(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Question) error

AddCreatedByQuestions adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.CreatedByQuestions. Sets related.R.CreatedByUser appropriately.

func (*User) AddOwnerRevokeTokens

func (o *User) AddOwnerRevokeTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*RevokeToken) error

AddOwnerRevokeTokens adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.OwnerRevokeTokens. Sets related.R.Owner appropriately.

func (*User) AddRatedByRatings

func (o *User) AddRatedByRatings(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Rating) error

AddRatedByRatings adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.RatedByRatings. Sets related.R.RatedByUser appropriately.

func (*User) CreatedByAnswers

func (o *User) CreatedByAnswers(mods ...qm.QueryMod) answerQuery

CreatedByAnswers retrieves all the answer's Answers with an executor via created_by column.

func (*User) CreatedByQuestions

func (o *User) CreatedByQuestions(mods ...qm.QueryMod) questionQuery

CreatedByQuestions retrieves all the question's Questions with an executor via created_by column.

func (*User) Delete

func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single User record with an executor. Delete will match against the primary key column to find the record to delete.

func (*User) Insert

func (o *User) 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 (*User) OwnerRevokeTokens

func (o *User) OwnerRevokeTokens(mods ...qm.QueryMod) revokeTokenQuery

OwnerRevokeTokens retrieves all the revoke_token's RevokeTokens with an executor via owner_id column.

func (*User) RatedByRatings

func (o *User) RatedByRatings(mods ...qm.QueryMod) ratingQuery

RatedByRatings retrieves all the rating's Ratings with an executor via rated_by column.

func (*User) Reload

func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*User) Update

func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the User. 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 (*User) Upsert

func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) 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 UserHook

type UserHook func(context.Context, boil.ContextExecutor, *User) error

UserHook is the signature for custom User hook methods

type UserSlice

type UserSlice []*User

UserSlice is an alias for a slice of pointers to User. This should generally be used opposed to []User.

func (UserSlice) DeleteAll

func (o UserSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*UserSlice) ReloadAll

func (o *UserSlice) 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 (UserSlice) UpdateAll

func (o UserSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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