Documentation ¶
Index ¶
- Variables
- func AddPostHook(hookPoint boil.HookPoint, postHook PostHook)
- func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)
- func NewQuery(mods ...qm.QueryMod) *queries.Query
- func PostExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Posts(mods ...qm.QueryMod) postQuery
- func UserExists(ctx context.Context, exec boil.ContextExecutor, iD int) (bool, error)
- func Users(mods ...qm.QueryMod) userQuery
- 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) RemoveUser(ctx context.Context, exec boil.ContextExecutor, related *User) 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 UpsertOptionFunc
- type UpsertOptions
- type User
- func (o *User) AddPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) 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) RemovePosts(ctx context.Context, exec boil.ContextExecutor, related ...*Post) error
- func (o *User) SetPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
- 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("sqlboiler: 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 CreatedAt string UpdatedAt string UserID string }{ ID: "id", Title: "title", CreatedAt: "created_at", UpdatedAt: "updated_at", UserID: "user_id", }
var PostRels = struct { User string }{ User: "User", }
PostRels is where relationship names are stored.
var PostTableColumns = struct { ID string Title string CreatedAt string UpdatedAt string UserID string }{ ID: "posts.id", Title: "posts.title", CreatedAt: "posts.created_at", UpdatedAt: "posts.updated_at", UserID: "posts.user_id", }
var PostWhere = struct { ID whereHelperint Title whereHelpernull_String CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time UserID whereHelpernull_Int }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Title: whereHelpernull_String{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UserID: whereHelpernull_Int{/* contains filtered or unexported fields */}, }
var TableNames = struct { Posts string Users string }{ Posts: "posts", Users: "users", }
var UserColumns = struct { ID string Name string CreatedAt string UpdatedAt string }{ ID: "id", Name: "name", CreatedAt: "created_at", UpdatedAt: "updated_at", }
var UserRels = struct { Posts string }{ Posts: "Posts", }
UserRels is where relationship names are stored.
var UserTableColumns = struct { ID string Name string CreatedAt string UpdatedAt string }{ ID: "users.id", Name: "users.name", CreatedAt: "users.created_at", UpdatedAt: "users.updated_at", }
var UserWhere = struct { ID whereHelperint Name whereHelperstring CreatedAt whereHelpertime_Time UpdatedAt whereHelpertime_Time }{ ID: whereHelperint{/* contains filtered or unexported fields */}, Name: whereHelperstring{/* contains filtered or unexported fields */}, CreatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, UpdatedAt: whereHelpertime_Time{/* contains filtered or unexported fields */}, }
var ViewNames = struct {
}{}
Functions ¶
func AddPostHook ¶
AddPostHook registers your hook function for all future operations.
func AddUserHook ¶
AddUserHook registers your hook function for all future operations.
func PostExists ¶
PostExists checks if the Post row exists.
func UserExists ¶
UserExists checks if the User row exists.
Types ¶
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 null.String `boil:"title" json:"title,omitempty" toml:"title" yaml:"title,omitempty"` 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"` UserID null.Int `boil:"user_id" json:"user_id,omitempty" toml:"user_id" yaml:"user_id,omitempty"` 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 int, 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) RemoveUser ¶
RemoveUser relationship. Sets o.R.User to nil. Removes o from all passed in related items' relationships struct.
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, opts ...UpsertOptionFunc) 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 UpsertOptionFunc ¶
type UpsertOptionFunc func(o *UpsertOptions)
func UpsertConflictTarget ¶
func UpsertConflictTarget(conflictTarget string) UpsertOptionFunc
func UpsertUpdateSet ¶
func UpsertUpdateSet(updateSet string) UpsertOptionFunc
type UpsertOptions ¶
type UpsertOptions struct {
// contains filtered or unexported fields
}
type User ¶
type User struct { ID int `boil:"id" json:"id" toml:"id" yaml:"id"` Name string `boil:"name" json:"name" toml:"name" yaml:"name"` 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"` 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 int, 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) 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) RemovePosts ¶
RemovePosts relationships from objects passed in. Removes related items from R.Posts (uses pointer comparison, removal does not keep order) Sets related.R.User.
func (*User) SetPosts ¶
func (o *User) SetPosts(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Post) error
SetPosts removes all previously related items of the user replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.User's Posts accordingly. Replaces o.R.Posts with related. Sets related.R.User's Posts accordingly.
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, opts ...UpsertOptionFunc) 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.