models

package
v0.0.0-...-7b1381d Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AliasColumns = struct {
	ID       string
	UserID   string
	ClientID string
	Alias    string
}{
	ID:       "id",
	UserID:   "user_id",
	ClientID: "client_id",
	Alias:    "alias",
}
View Source
var AliasRels = struct {
	Client string
	User   string
}{
	Client: "Client",
	User:   "User",
}

AliasRels is where relationship names are stored.

View Source
var AliasWhere = struct {
	ID       whereHelperint64
	UserID   whereHelperint64
	ClientID whereHelperint64
	Alias    whereHelperstring
}{
	ID:       whereHelperint64{/* contains filtered or unexported fields */},
	UserID:   whereHelperint64{/* contains filtered or unexported fields */},
	ClientID: whereHelperint64{/* contains filtered or unexported fields */},
	Alias:    whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var ClientColumns = struct {
	ID     string
	Name   string
	Secret string
}{
	ID:     "id",
	Name:   "name",
	Secret: "secret",
}
View Source
var ClientRels = struct {
	Aliases string
}{
	Aliases: "Aliases",
}

ClientRels is where relationship names are stored.

View Source
var ClientWhere = struct {
	ID     whereHelperint64
	Name   whereHelperstring
	Secret whereHelper__byte
}{
	ID:     whereHelperint64{/* contains filtered or unexported fields */},
	Name:   whereHelperstring{/* contains filtered or unexported fields */},
	Secret: whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var ElectionColumns = struct {
	ID        string
	Key       string
	Question  string
	Choices   string
	CreatedAt string
	BallotKey string
	Close     string
	CloseTZ   string
	Flags     string
	UserID    string
}{
	ID:        "id",
	Key:       "key",
	Question:  "question",
	Choices:   "choices",
	CreatedAt: "created_at",
	BallotKey: "ballot_key",
	Close:     "close",
	CloseTZ:   "close_tz",
	Flags:     "flags",
	UserID:    "user_id",
}
View Source
var ElectionRels = struct {
	User  string
	Votes string
}{
	User:  "User",
	Votes: "Votes",
}

ElectionRels is where relationship names are stored.

View Source
var ElectionWhere = struct {
	ID        whereHelperint64
	Key       whereHelperstring
	Question  whereHelperstring
	Choices   whereHelpertypes_StringArray
	CreatedAt whereHelperpgtype_Timestamptz
	BallotKey whereHelperstring
	Close     whereHelperpgtype_Timestamptz
	CloseTZ   whereHelpernull_String
	Flags     whereHelpertypes_StringArray
	UserID    whereHelperint64
}{
	ID:        whereHelperint64{/* contains filtered or unexported fields */},
	Key:       whereHelperstring{/* contains filtered or unexported fields */},
	Question:  whereHelperstring{/* contains filtered or unexported fields */},
	Choices:   whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	CreatedAt: whereHelperpgtype_Timestamptz{/* contains filtered or unexported fields */},
	BallotKey: whereHelperstring{/* contains filtered or unexported fields */},
	Close:     whereHelperpgtype_Timestamptz{/* contains filtered or unexported fields */},
	CloseTZ:   whereHelpernull_String{/* contains filtered or unexported fields */},
	Flags:     whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	UserID:    whereHelperint64{/* 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 TableNames = struct {
	Alias    string
	Client   string
	Election string
	User     string
	Vote     string
}{
	Alias:    "alias",
	Client:   "client",
	Election: "election",
	User:     "user",
	Vote:     "vote",
}
View Source
var UserColumns = struct {
	ID string
}{
	ID: "id",
}
View Source
var UserRels = struct {
	Aliases   string
	Elections string
	Votes     string
}{
	Aliases:   "Aliases",
	Elections: "Elections",
	Votes:     "Votes",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	ID whereHelperint64
}{
	ID: whereHelperint64{/* contains filtered or unexported fields */},
}
View Source
var VoteColumns = struct {
	ID         string
	ElectionID string
	Name       string
	Choices    string
	CreatedAt  string
	UserID     string
}{
	ID:         "id",
	ElectionID: "election_id",
	Name:       "name",
	Choices:    "choices",
	CreatedAt:  "created_at",
	UserID:     "user_id",
}
View Source
var VoteRels = struct {
	Election string
	User     string
}{
	Election: "Election",
	User:     "User",
}

VoteRels is where relationship names are stored.

View Source
var VoteWhere = struct {
	ID         whereHelperint64
	ElectionID whereHelperint64
	Name       whereHelperstring
	Choices    whereHelpertypes_StringArray
	CreatedAt  whereHelperpgtype_Timestamptz
	UserID     whereHelperint64
}{
	ID:         whereHelperint64{/* contains filtered or unexported fields */},
	ElectionID: whereHelperint64{/* contains filtered or unexported fields */},
	Name:       whereHelperstring{/* contains filtered or unexported fields */},
	Choices:    whereHelpertypes_StringArray{/* contains filtered or unexported fields */},
	CreatedAt:  whereHelperpgtype_Timestamptz{/* contains filtered or unexported fields */},
	UserID:     whereHelperint64{/* contains filtered or unexported fields */},
}

Functions

func AliasExists

func AliasExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

AliasExists checks if the Alias row exists.

func Aliases

func Aliases(mods ...qm.QueryMod) aliasQuery

Aliases retrieves all the records using an executor.

func ClientExists

func ClientExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

ClientExists checks if the Client row exists.

func Clients

func Clients(mods ...qm.QueryMod) clientQuery

Clients retrieves all the records using an executor.

func ElectionExists

func ElectionExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

ElectionExists checks if the Election row exists.

func Elections

func Elections(mods ...qm.QueryMod) electionQuery

Elections 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 UserExists

func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (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.

func VoteExists

func VoteExists(ctx context.Context, exec boil.ContextExecutor, iD int64) (bool, error)

VoteExists checks if the Vote row exists.

func Votes

func Votes(mods ...qm.QueryMod) voteQuery

Votes retrieves all the records using an executor.

Types

type Alias

type Alias struct {
	ID       int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	UserID   int64  `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	ClientID int64  `boil:"client_id" json:"client_id" toml:"client_id" yaml:"client_id"`
	Alias    string `boil:"alias" json:"alias" toml:"alias" yaml:"alias"`

	R *aliasR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L aliasL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Alias is an object representing the database table.

func FindAlias

func FindAlias(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Alias, error)

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

func (*Alias) Client

func (o *Alias) Client(mods ...qm.QueryMod) clientQuery

Client pointed to by the foreign key.

func (*Alias) Delete

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

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

func (*Alias) Insert

func (o *Alias) 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 (*Alias) Reload

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

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

func (*Alias) SetClient

func (o *Alias) SetClient(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Client) error

SetClient of the alias to the related item. Sets o.R.Client to related. Adds o to related.R.Aliases.

func (*Alias) SetUser

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

SetUser of the alias to the related item. Sets o.R.User to related. Adds o to related.R.Aliases.

func (*Alias) Update

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

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

func (o *Alias) 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.

func (*Alias) User

func (o *Alias) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type AliasSlice

type AliasSlice []*Alias

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

func (AliasSlice) DeleteAll

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

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

func (*AliasSlice) ReloadAll

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

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

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

type Client

type Client struct {
	ID     int64  `boil:"id" json:"id" toml:"id" yaml:"id"`
	Name   string `boil:"name" json:"name" toml:"name" yaml:"name"`
	Secret []byte `boil:"secret" json:"secret" toml:"secret" yaml:"secret"`

	R *clientR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L clientL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Client is an object representing the database table.

func FindClient

func FindClient(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Client, error)

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

func (*Client) AddAliases

func (o *Client) AddAliases(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Alias) error

AddAliases adds the given related objects to the existing relationships of the client, optionally inserting them as new records. Appends related to o.R.Aliases. Sets related.R.Client appropriately.

func (*Client) Aliases

func (o *Client) Aliases(mods ...qm.QueryMod) aliasQuery

Aliases retrieves all the alias's Aliases with an executor.

func (*Client) Delete

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

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

func (*Client) Insert

func (o *Client) 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 (*Client) Reload

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

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

func (*Client) Update

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

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

func (o *Client) 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 ClientSlice

type ClientSlice []*Client

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

func (ClientSlice) DeleteAll

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

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

func (*ClientSlice) ReloadAll

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

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

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

type Election

type Election struct {
	ID        int64              `boil:"id" json:"id" toml:"id" yaml:"id"`
	Key       string             `boil:"key" json:"key" toml:"key" yaml:"key"`
	Question  string             `boil:"question" json:"question" toml:"question" yaml:"question"`
	Choices   types.StringArray  `boil:"choices" json:"choices" toml:"choices" yaml:"choices"`
	CreatedAt pgtype.Timestamptz `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	BallotKey string             `boil:"ballot_key" json:"ballot_key" toml:"ballot_key" yaml:"ballot_key"`
	Close     pgtype.Timestamptz `boil:"close" json:"close,omitempty" toml:"close" yaml:"close,omitempty"`
	CloseTZ   null.String        `boil:"close_tz" json:"close_tz,omitempty" toml:"close_tz" yaml:"close_tz,omitempty"`
	Flags     types.StringArray  `boil:"flags" json:"flags" toml:"flags" yaml:"flags"`
	UserID    int64              `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

	R *electionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L electionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Election is an object representing the database table.

func FindElection

func FindElection(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Election, error)

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

func (*Election) AddVotes

func (o *Election) AddVotes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Vote) error

AddVotes adds the given related objects to the existing relationships of the election, optionally inserting them as new records. Appends related to o.R.Votes. Sets related.R.Election appropriately.

func (*Election) Delete

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

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

func (*Election) Insert

func (o *Election) 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 (*Election) Reload

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

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

func (*Election) SetUser

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

SetUser of the election to the related item. Sets o.R.User to related. Adds o to related.R.Elections.

func (*Election) Update

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

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

func (o *Election) 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.

func (*Election) User

func (o *Election) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

func (*Election) Votes

func (o *Election) Votes(mods ...qm.QueryMod) voteQuery

Votes retrieves all the vote's Votes with an executor.

type ElectionSlice

type ElectionSlice []*Election

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

func (ElectionSlice) DeleteAll

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

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

func (*ElectionSlice) ReloadAll

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

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

type User struct {
	ID int64 `boil:"id" json:"id" toml:"id" yaml:"id"`

	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 int64, 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) AddAliases

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

AddAliases adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Aliases. Sets related.R.User appropriately.

func (*User) AddElections

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

AddElections adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Elections. Sets related.R.User appropriately.

func (*User) AddVotes

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

AddVotes adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Votes. Sets related.R.User appropriately.

func (*User) Aliases

func (o *User) Aliases(mods ...qm.QueryMod) aliasQuery

Aliases retrieves all the alias's Aliases with an executor.

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

func (o *User) Elections(mods ...qm.QueryMod) electionQuery

Elections retrieves all the election's Elections with an executor.

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

func (*User) Votes

func (o *User) Votes(mods ...qm.QueryMod) voteQuery

Votes retrieves all the vote's Votes with an executor.

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.

type Vote

type Vote struct {
	ID         int64              `boil:"id" json:"id" toml:"id" yaml:"id"`
	ElectionID int64              `boil:"election_id" json:"election_id" toml:"election_id" yaml:"election_id"`
	Name       string             `boil:"name" json:"name" toml:"name" yaml:"name"`
	Choices    types.StringArray  `boil:"choices" json:"choices" toml:"choices" yaml:"choices"`
	CreatedAt  pgtype.Timestamptz `boil:"created_at" json:"created_at" toml:"created_at" yaml:"created_at"`
	UserID     int64              `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

	R *voteR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L voteL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Vote is an object representing the database table.

func FindVote

func FindVote(ctx context.Context, exec boil.ContextExecutor, iD int64, selectCols ...string) (*Vote, error)

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

func (*Vote) Delete

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

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

func (*Vote) Election

func (o *Vote) Election(mods ...qm.QueryMod) electionQuery

Election pointed to by the foreign key.

func (*Vote) Insert

func (o *Vote) 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 (*Vote) Reload

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

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

func (*Vote) SetElection

func (o *Vote) SetElection(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Election) error

SetElection of the vote to the related item. Sets o.R.Election to related. Adds o to related.R.Votes.

func (*Vote) SetUser

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

SetUser of the vote to the related item. Sets o.R.User to related. Adds o to related.R.Votes.

func (*Vote) Update

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

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

func (o *Vote) 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.

func (*Vote) User

func (o *Vote) User(mods ...qm.QueryMod) userQuery

User pointed to by the foreign key.

type VoteSlice

type VoteSlice []*Vote

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

func (VoteSlice) DeleteAll

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

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

func (*VoteSlice) ReloadAll

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

func (o VoteSlice) 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