Documentation ¶
Index ¶
- Variables
- func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook)
- func AddPostHook(hookPoint boil.HookPoint, postHook PostHook)
- func AddTokenHook(hookPoint boil.HookPoint, tokenHook TokenHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func GorpMigrationExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func GorpMigrations(mods ...qm.QueryMod) gorpMigrationQuery
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func PostExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Posts(mods ...qm.QueryMod) postQuery
- func TokenExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Tokens(mods ...qm.QueryMod) tokenQuery
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD string) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- type GorpMigration
- func (o *GorpMigration) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *GorpMigration) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *GorpMigration) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *GorpMigration) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *GorpMigration) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *GorpMigration) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type GorpMigrationHook
- type GorpMigrationSlice
- func (o GorpMigrationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *GorpMigrationSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error
- func (o GorpMigrationSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)
- type M
- type Post
- func (o *Post) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Post) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Post) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Post) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Post) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *Post) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Post) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- func (o *Post) User(mods ...qm.QueryMod) userQuery
- type PostHook
- type PostSlice
- type Token
- func (o *Token) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *Token) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *Token) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *Token) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *Token) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
- func (o *Token) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *Token) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- func (o *Token) User(mods ...qm.QueryMod) userQuery
- type TokenHook
- type TokenSlice
- type User
- func (o *User) AddPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
- func (o *User) AddTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Token) error
- func (o *User) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
- func (o *User) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
- func (o *User) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error
- func (o *User) Posts(mods ...qm.QueryMod) postQuery
- func (o *User) Reload(ctx context.Context, exec boil.ContextExecutor) error
- func (o *User) Tokens(mods ...qm.QueryMod) tokenQuery
- func (o *User) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
- func (o *User) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, ...) error
- type UserHook
- type UserSlice
Constants ¶
This section is empty.
Variables ¶
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 GorpMigrationColumns = struct { ID string AppliedAt string }{ ID: "id", AppliedAt: "applied_at", }
var GorpMigrationRels = struct {
}{}
GorpMigrationRels is where relationship names are stored.
var GorpMigrationTableColumns = struct { ID string AppliedAt string }{ ID: "gorp_migrations.id", AppliedAt: "gorp_migrations.applied_at", }
var GorpMigrationWhere = struct { ID whereHelperstring AppliedAt whereHelpernull_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, AppliedAt: whereHelpernull_Time{/* contains filtered or unexported fields */}, }
var PostColumns = struct { ID string UserID string Content string }{ ID: "id", UserID: "user_id", Content: "content", }
var PostRels = struct { User string }{ User: "User", }
PostRels is where relationship names are stored.
var PostTableColumns = struct { ID string UserID string Content string }{ ID: "posts.id", UserID: "posts.user_id", Content: "posts.content", }
var PostWhere = struct { ID whereHelperstring UserID whereHelperstring Content whereHelperstring }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, UserID: whereHelperstring{/* contains filtered or unexported fields */}, Content: whereHelperstring{/* contains filtered or unexported fields */}, }
var TableNames = struct { GorpMigrations string Posts string Tokens string Users string }{ GorpMigrations: "gorp_migrations", Posts: "posts", Tokens: "tokens", Users: "users", }
var TokenColumns = struct { ID string UserID string ReadOnly string Invalid string Created string Expires string }{ ID: "id", UserID: "user_id", ReadOnly: "read_only", Invalid: "invalid", Created: "created", Expires: "expires", }
var TokenRels = struct { User string }{ User: "User", }
TokenRels is where relationship names are stored.
var TokenTableColumns = struct { ID string UserID string ReadOnly string Invalid string Created string Expires string }{ ID: "tokens.id", UserID: "tokens.user_id", ReadOnly: "tokens.read_only", Invalid: "tokens.invalid", Created: "tokens.created", Expires: "tokens.expires", }
var TokenWhere = struct { ID whereHelperstring UserID whereHelperstring ReadOnly whereHelperbool Invalid whereHelperbool Created whereHelpertime_Time Expires whereHelpertime_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, UserID: whereHelperstring{/* contains filtered or unexported fields */}, ReadOnly: whereHelperbool{/* contains filtered or unexported fields */}, Invalid: whereHelperbool{/* contains filtered or unexported fields */}, Created: whereHelpertime_Time{/* contains filtered or unexported fields */}, Expires: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var UserColumns = struct { ID string Username string Email string Password string External string Bio string Pronouns string ProfilePicture string IsAdmin string Created string }{ ID: "id", Username: "username", Email: "email", Password: "password", External: "external", Bio: "bio", Pronouns: "pronouns", ProfilePicture: "profile_picture", IsAdmin: "is_admin", Created: "created", }
var UserRels = struct { Posts string Tokens string }{ Posts: "Posts", Tokens: "Tokens", }
UserRels is where relationship names are stored.
var UserTableColumns = struct { ID string Username string Email string Password string External string Bio string Pronouns string ProfilePicture string IsAdmin string Created string }{ ID: "users.id", Username: "users.username", Email: "users.email", Password: "users.password", External: "users.external", Bio: "users.bio", Pronouns: "users.pronouns", ProfilePicture: "users.profile_picture", IsAdmin: "users.is_admin", Created: "users.created", }
var UserWhere = struct { ID whereHelperstring Username whereHelperstring Email whereHelpernull_String Password whereHelpernull_String External whereHelperbool Bio whereHelpernull_String Pronouns whereHelpernull_String ProfilePicture whereHelpernull_String IsAdmin whereHelperbool Created whereHelpertime_Time }{ ID: whereHelperstring{/* contains filtered or unexported fields */}, Username: whereHelperstring{/* contains filtered or unexported fields */}, Email: whereHelpernull_String{/* contains filtered or unexported fields */}, Password: whereHelpernull_String{/* contains filtered or unexported fields */}, External: whereHelperbool{/* contains filtered or unexported fields */}, Bio: whereHelpernull_String{/* contains filtered or unexported fields */}, Pronouns: whereHelpernull_String{/* contains filtered or unexported fields */}, ProfilePicture: whereHelpernull_String{/* contains filtered or unexported fields */}, IsAdmin: whereHelperbool{/* contains filtered or unexported fields */}, Created: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ViewNames = struct {
}{}
Functions ¶
func AddGorpMigrationHook ¶
func AddGorpMigrationHook(hookPoint boil.HookPoint, gorpMigrationHook GorpMigrationHook)
AddGorpMigrationHook registers your hook function for all future operations.
func AddPostHook ¶
AddPostHook registers your hook function for all future operations.
func AddTokenHook ¶
AddTokenHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func GorpMigrationExists ¶
GorpMigrationExists checks if the GorpMigration row exists.
func GorpMigrations ¶
GorpMigrations retrieves all the records using an executor.
func PostExists ¶
PostExists checks if the Post row exists.
func TokenExists ¶
TokenExists checks if the Token row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
type GorpMigration ¶
type GorpMigration struct { ID string `boil:"id" json:"id" toml:"id" yaml:"id"` AppliedAt null.Time `boil:"applied_at" json:"applied_at,omitempty" toml:"applied_at" yaml:"applied_at,omitempty"` R *gorpMigrationR `boil:"-" json:"-" toml:"-" yaml:"-"` L gorpMigrationL `boil:"-" json:"-" toml:"-" yaml:"-"` }
GorpMigration is an object representing the database table.
func FindGorpMigration ¶
func FindGorpMigration(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*GorpMigration, error)
FindGorpMigration retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*GorpMigration) Delete ¶
func (o *GorpMigration) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)
Delete deletes a single GorpMigration record with an executor. Delete will match against the primary key column to find the record to delete.
func (*GorpMigration) Exists ¶
func (o *GorpMigration) Exists(ctx context.Context, exec boil.ContextExecutor) (bool, error)
Exists checks if the GorpMigration row exists.
func (*GorpMigration) Insert ¶
func (o *GorpMigration) 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 (*GorpMigration) Reload ¶
func (o *GorpMigration) Reload(ctx context.Context, exec boil.ContextExecutor) error
Reload refetches the object from the database using the primary keys with an executor.
func (*GorpMigration) Update ¶
func (o *GorpMigration) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the GorpMigration. 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 (*GorpMigration) Upsert ¶
func (o *GorpMigration) 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 GorpMigrationHook ¶
type GorpMigrationHook func(context.Context, boil.ContextExecutor, *GorpMigration) error
GorpMigrationHook is the signature for custom GorpMigration hook methods
type GorpMigrationSlice ¶
type GorpMigrationSlice []*GorpMigration
GorpMigrationSlice is an alias for a slice of pointers to GorpMigration. This should almost always be used instead of []GorpMigration.
func (GorpMigrationSlice) DeleteAll ¶
func (o GorpMigrationSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*GorpMigrationSlice) ReloadAll ¶
func (o *GorpMigrationSlice) 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 (GorpMigrationSlice) UpdateAll ¶
func (o GorpMigrationSlice) 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 Post ¶
type Post 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"` Content string `boil:"content" json:"content" toml:"content" yaml:"content"` R *postR `boil:"-" json:"-" toml:"-" yaml:"-"` L postL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Post is an object representing the database table.
func FindPost ¶
func FindPost(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Post, error)
FindPost retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Post) Delete ¶
Delete deletes a single Post record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Post) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Post) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Post) SetUser ¶
func (o *Post) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the post to the related item. Sets o.R.User to related. Adds o to related.R.Posts.
func (*Post) Update ¶
func (o *Post) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Post. 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 (*Post) Upsert ¶
func (o *Post) 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 PostSlice ¶
type PostSlice []*Post
PostSlice is an alias for a slice of pointers to Post. This should almost always be used instead of []Post.
type Token ¶
type Token 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"` ReadOnly bool `boil:"read_only" json:"read_only" toml:"read_only" yaml:"read_only"` Invalid bool `boil:"invalid" json:"invalid" toml:"invalid" yaml:"invalid"` Created time.Time `boil:"created" json:"created" toml:"created" yaml:"created"` Expires time.Time `boil:"expires" json:"expires" toml:"expires" yaml:"expires"` R *tokenR `boil:"-" json:"-" toml:"-" yaml:"-"` L tokenL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Token is an object representing the database table.
func FindToken ¶
func FindToken(ctx context.Context, exec boil.ContextExecutor, iD string, selectCols ...string) (*Token, error)
FindToken retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func (*Token) Delete ¶
Delete deletes a single Token record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Token) Insert ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*Token) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Token) SetUser ¶
func (o *Token) SetUser(ctx context.Context, exec boil.ContextExecutor, insert bool, related *User) error
SetUser of the token to the related item. Sets o.R.User to related. Adds o to related.R.Tokens.
func (*Token) Update ¶
func (o *Token) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)
Update uses an executor to update the Token. 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 (*Token) Upsert ¶
func (o *Token) 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 TokenSlice ¶
type TokenSlice []*Token
TokenSlice is an alias for a slice of pointers to Token. This should almost always be used instead of []Token.
func (TokenSlice) DeleteAll ¶
func (o TokenSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)
DeleteAll deletes all rows in the slice, using an executor.
func (*TokenSlice) ReloadAll ¶
func (o *TokenSlice) 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 (TokenSlice) UpdateAll ¶
func (o TokenSlice) 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"` Email null.String `boil:"email" json:"email,omitempty" toml:"email" yaml:"email,omitempty"` Password null.String `boil:"password" json:"password,omitempty" toml:"password" yaml:"password,omitempty"` External bool `boil:"external" json:"external" toml:"external" yaml:"external"` Bio null.String `boil:"bio" json:"bio,omitempty" toml:"bio" yaml:"bio,omitempty"` Pronouns null.String `boil:"pronouns" json:"pronouns,omitempty" toml:"pronouns" yaml:"pronouns,omitempty"` ProfilePicture null.String `boil:"profile_picture" json:"profile_picture,omitempty" toml:"profile_picture" yaml:"profile_picture,omitempty"` IsAdmin bool `boil:"is_admin" json:"is_admin" toml:"is_admin" yaml:"is_admin"` Created time.Time `boil:"created" json:"created" toml:"created" yaml:"created"` 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) AddPosts ¶
func (o *User) AddPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
AddPosts adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Posts. Sets related.R.User appropriately.
func (*User) AddTokens ¶
func (o *User) AddTokens(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Token) error
AddTokens adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Tokens. Sets related.R.User appropriately.
func (*User) Delete ¶
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 ¶
Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.
func (*User) Reload ¶
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 UserSlice ¶
type UserSlice []*User
UserSlice is an alias for a slice of pointers to User. This should almost always be used instead of []User.