Documentation ¶
Index ¶
- Constants
- Variables
- func BallotExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Ballots(mods ...qm.QueryMod) ballotQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func PollExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)
- func Polls(mods ...qm.QueryMod) pollQuery
- type Ballot
- func (o *Ballot) Delete(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Ballot) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Ballot) Poll(mods ...qm.QueryMod) pollQuery
- func (o *Ballot) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Ballot) SetPoll(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Poll) error
- func (o *Ballot) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Ballot) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type BallotSlice
- type M
- type Poll
- func (o *Poll) AddBallots(ctx context.Context, exec boil.ContextExecutor, insert bool, ...) error
- func (o *Poll) Ballots(mods ...qm.QueryMod) ballotQuery
- func (o *Poll) Delete(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Poll) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Poll) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Poll) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Poll) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type PollSlice
Constants ¶
const ( BallotCheckModeNone = "none" BallotCheckModeIP = "ip" BallotCheckModeCookie = "cookie" BallotCheckModeIPAndCookie = "ip_and_cookie" )
Enum values for ballot_check_mode
Variables ¶
var BallotColumns = struct { ID string CreatedAt string UpdatedAt string PollID string Cookie string IPAddr string Votes string }{ ID: "id", CreatedAt: "created_at", UpdatedAt: "updated_at", PollID: "poll_id", Cookie: "cookie", IPAddr: "ip_addr", Votes: "votes", }
var BallotRels = struct { Poll string }{ Poll: "Poll", }
BallotRels is where relationship names are stored.
var BallotWhere = struct { ID whereHelperint64 CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time PollID whereHelperint64 Cookie whereHelpernull_String IPAddr whereHelpernull_String Votes whereHelpertypes_Int64Array }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, PollID: whereHelperint64{/* contains filtered or unexported fields */}, Cookie: whereHelpernull_String{/* contains filtered or unexported fields */}, IPAddr: whereHelpernull_String{/* contains filtered or unexported fields */}, Votes: whereHelpertypes_Int64Array{/* 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 PollColumns = struct { ID string CreatedAt string UpdatedAt string Question string Choices string CheckMode string }{ ID: "id", CreatedAt: "created_at", UpdatedAt: "updated_at", Question: "question", Choices: "choices", CheckMode: "check_mode", }
var PollRels = struct { Ballots string }{ Ballots: "Ballots", }
PollRels is where relationship names are stored.
var PollWhere = struct { ID whereHelperint64 CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time Question whereHelperstring Choices whereHelpertypes_StringArray CheckMode whereHelperstring }{ ID: whereHelperint64{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, Question: whereHelperstring{/* contains filtered or unexported fields */}, Choices: whereHelpertypes_StringArray{/* contains filtered or unexported fields */}, CheckMode: whereHelperstring{/* contains filtered or unexported fields */}, }
var TableNames = struct { Ballots string Polls string }{ Ballots: "ballots", Polls: "polls", }
Functions ¶
func BallotExists ¶
BallotExists checks if the Ballot row exists.
func PollExists ¶
PollExists checks if the Poll row exists.
Types ¶
type Ballot ¶
type Ballot struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` PollID int64 `boil:"poll_id" json:"poll_id" toml:"poll_id" yaml:"poll_id"` Cookie null.String `boil:"cookie" json:"cookie,omitempty" toml:"cookie" yaml:"cookie,omitempty"` IPAddr null.String `boil:"ip_addr" json:"ip_addr,omitempty" toml:"ip_addr" yaml:"ip_addr,omitempty"` Votes types.Int64Array `boil:"votes" json:"votes,omitempty" toml:"votes" yaml:"votes,omitempty"` R *ballotR `boil:"-" json:"-" toml:"-" yaml:"-"` L ballotL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Ballot is an object representing the database table.
func FindBallot ¶
func FindBallot(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Ballot, error)
FindBallot retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Ballot) Delete ¶
Delete deletes a single Ballot record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Ballot) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Ballot) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Ballot) SetPoll ¶
func (o *Ballot) SetPoll(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Poll) error
SetPoll of the ballot to the related item. Sets o.R.Poll to related. Adds o to related.R.Ballots.
func (*Ballot) Update ¶
Update uses an executor to update the Ballot. 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 (*Ballot) Upsert ¶
func (o *Ballot) 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 BallotSlice ¶
type BallotSlice []*Ballot
BallotSlice is an alias for a slice of pointers to Ballot. This should generally be used opposed to []Ballot.
func (BallotSlice) DeleteAll ¶
func (o BallotSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) error
DeleteAll deletes all rows in the slice, using an executor.
func (*BallotSlice) ReloadAll ¶
func (o *BallotSlice) 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 (BallotSlice) UpdateAll ¶
func (o BallotSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) 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 Poll ¶
type Poll struct { ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"` CreatedAt time.Time `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"` UpdatedAt time.Time `boil:"updated_at" json:"updated_at" toml:"updated_at" yaml:"updated_at"` Question string `boil:"question" json:"question" toml:"question" yaml:"question"` Choices types.StringArray `boil:"choices" json:"choices,omitempty" toml:"choices" yaml:"choices,omitempty"` CheckMode string `boil:"check_mode" json:"check_mode" toml:"check_mode" yaml:"check_mode"` R *pollR `boil:"-" json:"-" toml:"-" yaml:"-"` L pollL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Poll is an object representing the database table.
func FindPoll ¶
func FindPoll(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Poll, error)
FindPoll retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Poll) AddBallots ¶
func (o *Poll) AddBallots(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Ballot) error
AddBallots adds the given related objects to the existing relationships of the poll, optionally inserting them as new records. Appends related to o.R.Ballots. Sets related.R.Poll appropriately.
func (*Poll) Delete ¶
Delete deletes a single Poll record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Poll) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Poll) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Poll) Update ¶
Update uses an executor to update the Poll. 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 (*Poll) Upsert ¶
func (o *Poll) 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 PollSlice ¶
type PollSlice []*Poll
PollSlice is an alias for a slice of pointers to Poll. This should generally be used opposed to []Poll.