Documentation ¶
Index ¶
- Variables
- func AddCommentHook(hookPoint boil.HookPoint, commentHook CommentHook)
- func AddPostHook(hookPoint boil.HookPoint, postHook PostHook)
- func CommentExists(exec boil.Executor, id int) (bool, error)
- func CommentExistsG(id int) (bool, error)
- func CommentExistsGP(id int) bool
- func CommentExistsP(exec boil.Executor, id int) bool
- func Comments(exec boil.Executor, mods ...qm.QueryMod) commentQuery
- func CommentsG(mods ...qm.QueryMod) commentQuery
- func NewQuery(exec boil.Executor, mods ...qm.QueryMod) *queries.Query
- func NewQueryG(mods ...qm.QueryMod) *queries.Query
- func PostExists(exec boil.Executor, id int) (bool, error)
- func PostExistsG(id int) (bool, error)
- func PostExistsGP(id int) bool
- func PostExistsP(exec boil.Executor, id int) bool
- func Posts(exec boil.Executor, mods ...qm.QueryMod) postQuery
- func PostsG(mods ...qm.QueryMod) postQuery
- type Comment
- func (o *Comment) Delete(exec boil.Executor) error
- func (o *Comment) DeleteG() error
- func (o *Comment) DeleteGP()
- func (o *Comment) DeleteP(exec boil.Executor)
- func (o *Comment) Insert(exec boil.Executor, whitelist ...string) error
- func (o *Comment) InsertG(whitelist ...string) error
- func (o *Comment) InsertGP(whitelist ...string)
- func (o *Comment) InsertP(exec boil.Executor, whitelist ...string)
- func (o *Comment) Post(exec boil.Executor, mods ...qm.QueryMod) postQuery
- func (o *Comment) PostG(mods ...qm.QueryMod) postQuery
- func (o *Comment) Reload(exec boil.Executor) error
- func (o *Comment) ReloadG() error
- func (o *Comment) ReloadGP()
- func (o *Comment) ReloadP(exec boil.Executor)
- func (o *Comment) SetPost(exec boil.Executor, insert bool, related *Post) error
- func (o *Comment) SetPostG(insert bool, related *Post) error
- func (o *Comment) SetPostGP(insert bool, related *Post)
- func (o *Comment) SetPostP(exec boil.Executor, insert bool, related *Post)
- func (o *Comment) Update(exec boil.Executor, whitelist ...string) error
- func (o *Comment) UpdateG(whitelist ...string) error
- func (o *Comment) UpdateGP(whitelist ...string)
- func (o *Comment) UpdateP(exec boil.Executor, whitelist ...string)
- func (o *Comment) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...) error
- func (o *Comment) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns []string, ...) error
- func (o *Comment) UpsertGP(updateOnConflict bool, conflictColumns []string, updateColumns []string, ...)
- func (o *Comment) UpsertP(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...)
- type CommentHook
- type CommentSlice
- func (o CommentSlice) DeleteAll(exec boil.Executor) error
- func (o CommentSlice) DeleteAllG() error
- func (o CommentSlice) DeleteAllGP()
- func (o CommentSlice) DeleteAllP(exec boil.Executor)
- func (o *CommentSlice) ReloadAll(exec boil.Executor) error
- func (o *CommentSlice) ReloadAllG() error
- func (o *CommentSlice) ReloadAllGP()
- func (o *CommentSlice) ReloadAllP(exec boil.Executor)
- func (o CommentSlice) UpdateAll(exec boil.Executor, cols M) error
- func (o CommentSlice) UpdateAllG(cols M) error
- func (o CommentSlice) UpdateAllGP(cols M)
- func (o CommentSlice) UpdateAllP(exec boil.Executor, cols M)
- type M
- type Post
- func (o *Post) AddComments(exec boil.Executor, insert bool, related ...*Comment) error
- func (o *Post) AddCommentsG(insert bool, related ...*Comment) error
- func (o *Post) AddCommentsGP(insert bool, related ...*Comment)
- func (o *Post) AddCommentsP(exec boil.Executor, insert bool, related ...*Comment)
- func (o *Post) Comments(exec boil.Executor, mods ...qm.QueryMod) commentQuery
- func (o *Post) CommentsG(mods ...qm.QueryMod) commentQuery
- func (o *Post) Delete(exec boil.Executor) error
- func (o *Post) DeleteG() error
- func (o *Post) DeleteGP()
- func (o *Post) DeleteP(exec boil.Executor)
- func (o *Post) Insert(exec boil.Executor, whitelist ...string) error
- func (o *Post) InsertG(whitelist ...string) error
- func (o *Post) InsertGP(whitelist ...string)
- func (o *Post) InsertP(exec boil.Executor, whitelist ...string)
- func (o *Post) Reload(exec boil.Executor) error
- func (o *Post) ReloadG() error
- func (o *Post) ReloadGP()
- func (o *Post) ReloadP(exec boil.Executor)
- func (o *Post) Update(exec boil.Executor, whitelist ...string) error
- func (o *Post) UpdateG(whitelist ...string) error
- func (o *Post) UpdateGP(whitelist ...string)
- func (o *Post) UpdateP(exec boil.Executor, whitelist ...string)
- func (o *Post) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...) error
- func (o *Post) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns []string, ...) error
- func (o *Post) UpsertGP(updateOnConflict bool, conflictColumns []string, updateColumns []string, ...)
- func (o *Post) UpsertP(exec boil.Executor, updateOnConflict bool, conflictColumns []string, ...)
- type PostHook
- type PostSlice
- func (o PostSlice) DeleteAll(exec boil.Executor) error
- func (o PostSlice) DeleteAllG() error
- func (o PostSlice) DeleteAllGP()
- func (o PostSlice) DeleteAllP(exec boil.Executor)
- func (o *PostSlice) ReloadAll(exec boil.Executor) error
- func (o *PostSlice) ReloadAllG() error
- func (o *PostSlice) ReloadAllGP()
- func (o *PostSlice) ReloadAllP(exec boil.Executor)
- func (o PostSlice) UpdateAll(exec boil.Executor, cols M) error
- func (o PostSlice) UpdateAllG(cols M) error
- func (o PostSlice) UpdateAllGP(cols M)
- func (o PostSlice) UpdateAllP(exec boil.Executor, cols M)
Constants ¶
This section is empty.
Variables ¶
var CommentColumns = struct { ID string PostID string Author string Body string Notes string CreatedAt string UpdatedAt string }{ ID: "id", PostID: "post_id", Author: "author", Body: "body", Notes: "notes", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var ErrSyncFail = errors.New("dbmodel: 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 PostColumns = struct { ID string Title string Author string Body string Notes string CreatedAt string UpdatedAt string }{ ID: "id", Title: "title", Author: "author", Body: "body", Notes: "notes", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var TableNames = struct { Comment string Post string }{ Comment: "comment", Post: "post", }
Functions ¶
func AddCommentHook ¶
func AddCommentHook(hookPoint boil.HookPoint, commentHook CommentHook)
AddCommentHook registers your hook function for all future operations.
func AddPostHook ¶
AddPostHook registers your hook function for all future operations.
func CommentExists ¶
CommentExists checks if the Comment row exists.
func CommentExistsG ¶
CommentExistsG checks if the Comment row exists.
func CommentExistsGP ¶
CommentExistsGP checks if the Comment row exists. Panics on error.
func CommentExistsP ¶
CommentExistsP checks if the Comment row exists. Panics on error.
func PostExists ¶
PostExists checks if the Post row exists.
func PostExistsG ¶
PostExistsG checks if the Post row exists.
func PostExistsGP ¶
PostExistsGP checks if the Post row exists. Panics on error.
func PostExistsP ¶
PostExistsP checks if the Post row exists. Panics on error.
Types ¶
type Comment ¶
type Comment struct { ID int `boil:"id" json:"id" toml:"id" yaml:"id"` PostID int `boil:"post_id" json:"post_id" toml:"post_id" yaml:"post_id"` Author string `boil:"author" json:"author" toml:"author" yaml:"author"` Body string `boil:"body" json:"body" toml:"body" yaml:"body"` Notes null.String `boil:"notes" json:"notes,omitempty" toml:"notes" yaml:"notes,omitempty"` CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"` UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"` R *commentR `boil:"-" json:"-" toml:"-" yaml:"-"` L commentL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Comment is an object representing the database table.
func FindComment ¶
FindComment retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func FindCommentG ¶
FindCommentG retrieves a single record by ID.
func FindCommentGP ¶
FindCommentGP retrieves a single record by ID, and panics on error.
func FindCommentP ¶
FindCommentP retrieves a single record by ID with an executor, and panics on error.
func (*Comment) Delete ¶
Delete deletes a single Comment record with an executor. Delete will match against the primary key column to find the record to delete.
func (*Comment) DeleteG ¶
DeleteG deletes a single Comment record. DeleteG will match against the primary key column to find the record to delete.
func (*Comment) DeleteGP ¶
func (o *Comment) DeleteGP()
DeleteGP deletes a single Comment record. DeleteGP will match against the primary key column to find the record to delete. Panics on error.
func (*Comment) DeleteP ¶
DeleteP deletes a single Comment record with an executor. DeleteP will match against the primary key column to find the record to delete. Panics on error.
func (*Comment) Insert ¶
Insert a single record using an executor. Whitelist behavior: If a whitelist is provided, only those columns supplied are inserted No whitelist behavior: Without a whitelist, columns are inferred by the following rules: - All columns without a default value are included (i.e. name, age) - All columns with a default, but non-zero are included (i.e. health = 75)
func (*Comment) InsertGP ¶
InsertGP a single record, and panics on error. See Insert for whitelist behavior description.
func (*Comment) InsertP ¶
InsertP a single record using an executor, and panics on error. See Insert for whitelist behavior description.
func (*Comment) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Comment) ReloadGP ¶
func (o *Comment) ReloadGP()
ReloadGP refetches the object from the database and panics on error.
func (*Comment) ReloadP ¶
ReloadP refetches the object from the database with an executor. Panics on error.
func (*Comment) SetPost ¶
SetPost of the comment to the related item. Sets o.R.Post to related. Adds o to related.R.Comments.
func (*Comment) SetPostG ¶
SetPostG of the comment to the related item. Sets o.R.Post to related. Adds o to related.R.Comments. Uses the global database handle.
func (*Comment) SetPostGP ¶
SetPostGP of the comment to the related item. Sets o.R.Post to related. Adds o to related.R.Comments. Uses the global database handle and panics on error.
func (*Comment) SetPostP ¶
SetPostP of the comment to the related item. Sets o.R.Post to related. Adds o to related.R.Comments. Panics on error.
func (*Comment) Update ¶
Update uses an executor to update the Comment. Whitelist behavior: If a whitelist is provided, only the columns given are updated. No whitelist behavior: Without a whitelist, columns are inferred by the following rules: - All columns are inferred to start with - All primary keys are subtracted from this set Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Comment) UpdateG ¶
UpdateG a single Comment record. See Update for whitelist behavior description.
func (*Comment) UpdateGP ¶
UpdateGP a single Comment record. UpdateGP takes a whitelist of column names that should be updated. Panics on error. See Update for whitelist behavior description.
func (*Comment) UpdateP ¶
UpdateP uses an executor to update the Comment, and panics on error. See Update for whitelist behavior description.
func (*Comment) Upsert ¶
func (o *Comment) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict.
func (*Comment) UpsertG ¶
func (o *Comment) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error
UpsertG attempts an insert, and does an update or ignore on conflict.
type CommentHook ¶
CommentHook is the signature for custom Comment hook methods
type CommentSlice ¶
type CommentSlice []*Comment
CommentSlice is an alias for a slice of pointers to Comment. This should generally be used opposed to []Comment.
func (CommentSlice) DeleteAll ¶
func (o CommentSlice) DeleteAll(exec boil.Executor) error
DeleteAll deletes all rows in the slice, using an executor.
func (CommentSlice) DeleteAllG ¶
func (o CommentSlice) DeleteAllG() error
DeleteAllG deletes all rows in the slice.
func (CommentSlice) DeleteAllGP ¶
func (o CommentSlice) DeleteAllGP()
DeleteAllGP deletes all rows in the slice, and panics on error.
func (CommentSlice) DeleteAllP ¶
func (o CommentSlice) DeleteAllP(exec boil.Executor)
DeleteAllP deletes all rows in the slice, using an executor, and panics on error.
func (*CommentSlice) ReloadAll ¶
func (o *CommentSlice) ReloadAll(exec boil.Executor) error
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (*CommentSlice) ReloadAllG ¶
func (o *CommentSlice) ReloadAllG() error
ReloadAllG refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (*CommentSlice) ReloadAllGP ¶
func (o *CommentSlice) ReloadAllGP()
ReloadAllGP refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice. Panics on error.
func (*CommentSlice) ReloadAllP ¶
func (o *CommentSlice) ReloadAllP(exec boil.Executor)
ReloadAllP refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice. Panics on error.
func (CommentSlice) UpdateAll ¶
func (o CommentSlice) UpdateAll(exec boil.Executor, cols M) error
UpdateAll updates all rows with the specified column values, using an executor.
func (CommentSlice) UpdateAllG ¶
func (o CommentSlice) UpdateAllG(cols M) error
UpdateAllG updates all rows with the specified column values.
func (CommentSlice) UpdateAllGP ¶
func (o CommentSlice) UpdateAllGP(cols M)
UpdateAllGP updates all rows with the specified column values, and panics on error.
func (CommentSlice) UpdateAllP ¶
func (o CommentSlice) UpdateAllP(exec boil.Executor, cols M)
UpdateAllP updates all rows with the specified column values, and panics on error.
type M ¶
type M map[string]interface{}
M type is for providing columns and column values to UpdateAll.
type Post ¶
type Post struct { ID int `boil:"id" json:"id" toml:"id" yaml:"id"` Title string `boil:"title" json:"title" toml:"title" yaml:"title"` Author string `boil:"author" json:"author" toml:"author" yaml:"author"` Body string `boil:"body" json:"body" toml:"body" yaml:"body"` Notes null.String `boil:"notes" json:"notes,omitempty" toml:"notes" yaml:"notes,omitempty"` CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"` UpdatedAt null.Time `boil:"updated_at" json:"updated_at,omitempty" toml:"updated_at" yaml:"updated_at,omitempty"` R *postR `boil:"-" json:"-" toml:"-" yaml:"-"` L postL `boil:"-" json:"-" toml:"-" yaml:"-"` }
Post is an object representing the database table.
func FindPost ¶
FindPost retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.
func FindPostGP ¶
FindPostGP retrieves a single record by ID, and panics on error.
func (*Post) AddComments ¶
AddComments adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Comments. Sets related.R.Post appropriately.
func (*Post) AddCommentsG ¶
AddCommentsG adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Comments. Sets related.R.Post appropriately. Uses the global database handle.
func (*Post) AddCommentsGP ¶
AddCommentsGP adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Comments. Sets related.R.Post appropriately. Uses the global database handle and panics on error.
func (*Post) AddCommentsP ¶
AddCommentsP adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Comments. Sets related.R.Post appropriately. Panics on error.
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) DeleteG ¶
DeleteG deletes a single Post record. DeleteG will match against the primary key column to find the record to delete.
func (*Post) DeleteGP ¶
func (o *Post) DeleteGP()
DeleteGP deletes a single Post record. DeleteGP will match against the primary key column to find the record to delete. Panics on error.
func (*Post) DeleteP ¶
DeleteP deletes a single Post record with an executor. DeleteP will match against the primary key column to find the record to delete. Panics on error.
func (*Post) Insert ¶
Insert a single record using an executor. Whitelist behavior: If a whitelist is provided, only those columns supplied are inserted No whitelist behavior: Without a whitelist, columns are inferred by the following rules: - All columns without a default value are included (i.e. name, age) - All columns with a default, but non-zero are included (i.e. health = 75)
func (*Post) InsertGP ¶
InsertGP a single record, and panics on error. See Insert for whitelist behavior description.
func (*Post) InsertP ¶
InsertP a single record using an executor, and panics on error. See Insert for whitelist behavior description.
func (*Post) Reload ¶
Reload refetches the object from the database using the primary keys with an executor.
func (*Post) ReloadGP ¶
func (o *Post) ReloadGP()
ReloadGP refetches the object from the database and panics on error.
func (*Post) ReloadP ¶
ReloadP refetches the object from the database with an executor. Panics on error.
func (*Post) Update ¶
Update uses an executor to update the Post. Whitelist behavior: If a whitelist is provided, only the columns given are updated. No whitelist behavior: Without a whitelist, columns are inferred by the following rules: - All columns are inferred to start with - All primary keys are subtracted from this set Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.
func (*Post) UpdateGP ¶
UpdateGP a single Post record. UpdateGP takes a whitelist of column names that should be updated. Panics on error. See Update for whitelist behavior description.
func (*Post) UpdateP ¶
UpdateP uses an executor to update the Post, and panics on error. See Update for whitelist behavior description.
func (*Post) Upsert ¶
func (o *Post) Upsert(exec boil.Executor, updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error
Upsert attempts an insert using an executor, and does an update or ignore on conflict.
func (*Post) UpsertG ¶
func (o *Post) UpsertG(updateOnConflict bool, conflictColumns []string, updateColumns []string, whitelist ...string) error
UpsertG attempts an insert, and does an update or ignore on conflict.
type PostSlice ¶
type PostSlice []*Post
PostSlice is an alias for a slice of pointers to Post. This should generally be used opposed to []Post.
func (PostSlice) DeleteAllG ¶
DeleteAllG deletes all rows in the slice.
func (PostSlice) DeleteAllGP ¶
func (o PostSlice) DeleteAllGP()
DeleteAllGP deletes all rows in the slice, and panics on error.
func (PostSlice) DeleteAllP ¶
DeleteAllP deletes all rows in the slice, using an executor, and panics on error.
func (*PostSlice) ReloadAll ¶
ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (*PostSlice) ReloadAllG ¶
ReloadAllG refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.
func (*PostSlice) ReloadAllGP ¶
func (o *PostSlice) ReloadAllGP()
ReloadAllGP refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice. Panics on error.
func (*PostSlice) ReloadAllP ¶
ReloadAllP refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice. Panics on error.
func (PostSlice) UpdateAll ¶
UpdateAll updates all rows with the specified column values, using an executor.
func (PostSlice) UpdateAllG ¶
UpdateAllG updates all rows with the specified column values.
func (PostSlice) UpdateAllGP ¶
UpdateAllGP updates all rows with the specified column values, and panics on error.