models

package
v0.0.0-...-4e6cce8 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommentColumns = struct {
	ID      string
	Content string
	PostID  string
	UserID  string
}{
	ID:      "id",
	Content: "content",
	PostID:  "post_id",
	UserID:  "user_id",
}
View Source
var CommentLikeColumns = struct {
	ID        string
	CommentID string
	UserID    string
	CreatedAt string
	LikeType  string
}{
	ID:        "id",
	CommentID: "comment_id",
	UserID:    "user_id",
	CreatedAt: "created_at",
	LikeType:  "like_type",
}
View Source
var CommentLikeRels = struct {
	Comment string
	User    string
}{
	Comment: "Comment",
	User:    "User",
}

CommentLikeRels is where relationship names are stored.

View Source
var CommentLikeWhere = struct {
	ID        whereHelperuint
	CommentID whereHelperuint
	UserID    whereHelperuint
	CreatedAt whereHelpernull_Time
	LikeType  whereHelperstring
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	CommentID: whereHelperuint{/* contains filtered or unexported fields */},
	UserID:    whereHelperuint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	LikeType:  whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var CommentRels = struct {
	Post         string
	User         string
	CommentLikes string
}{
	Post:         "Post",
	User:         "User",
	CommentLikes: "CommentLikes",
}

CommentRels is where relationship names are stored.

View Source
var CommentWhere = struct {
	ID      whereHelperuint
	Content whereHelperstring
	PostID  whereHelperuint
	UserID  whereHelperuint
}{
	ID:      whereHelperuint{/* contains filtered or unexported fields */},
	Content: whereHelperstring{/* contains filtered or unexported fields */},
	PostID:  whereHelperuint{/* contains filtered or unexported fields */},
	UserID:  whereHelperuint{/* 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 FriendshipColumns = struct {
	ID        string
	CreatedAt string
}{
	ID:        "id",
	CreatedAt: "created_at",
}
View Source
var FriendshipRels = struct {
	Users string
}{
	Users: "Users",
}

FriendshipRels is where relationship names are stored.

View Source
var FriendshipWhere = struct {
	ID        whereHelperuint
	CreatedAt whereHelpernull_Time
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
}
View Source
var ImageColumns = struct {
	ID          string
	PostID      string
	Views       string
	OriginalURL string
}{
	ID:          "id",
	PostID:      "post_id",
	Views:       "views",
	OriginalURL: "original_url",
}
View Source
var ImageRels = struct {
	Post            string
	ImageVariations string
}{
	Post:            "Post",
	ImageVariations: "ImageVariations",
}

ImageRels is where relationship names are stored.

View Source
var ImageVariationColumns = struct {
	ID      string
	ImageID string
}{
	ID:      "id",
	ImageID: "image_id",
}
View Source
var ImageVariationRels = struct {
	Image string
}{
	Image: "Image",
}

ImageVariationRels is where relationship names are stored.

View Source
var ImageVariationWhere = struct {
	ID      whereHelperuint
	ImageID whereHelperuint
}{
	ID:      whereHelperuint{/* contains filtered or unexported fields */},
	ImageID: whereHelperuint{/* contains filtered or unexported fields */},
}
View Source
var ImageWhere = struct {
	ID          whereHelperuint
	PostID      whereHelperuint
	Views       whereHelpernull_Int
	OriginalURL whereHelpernull_String
}{
	ID:          whereHelperuint{/* contains filtered or unexported fields */},
	PostID:      whereHelperuint{/* contains filtered or unexported fields */},
	Views:       whereHelpernull_Int{/* contains filtered or unexported fields */},
	OriginalURL: whereHelpernull_String{/* contains filtered or unexported fields */},
}
View Source
var LikeColumns = struct {
	ID        string
	PostID    string
	UserID    string
	CreatedAt string
	LikeType  string
}{
	ID:        "id",
	PostID:    "post_id",
	UserID:    "user_id",
	CreatedAt: "created_at",
	LikeType:  "like_type",
}
View Source
var LikeRels = struct {
	Post string
	User string
}{
	Post: "Post",
	User: "User",
}

LikeRels is where relationship names are stored.

View Source
var LikeWhere = struct {
	ID        whereHelperuint
	PostID    whereHelperuint
	UserID    whereHelperuint
	CreatedAt whereHelpernull_Time
	LikeType  whereHelperstring
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	PostID:    whereHelperuint{/* contains filtered or unexported fields */},
	UserID:    whereHelperuint{/* contains filtered or unexported fields */},
	CreatedAt: whereHelpernull_Time{/* contains filtered or unexported fields */},
	LikeType:  whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var PostColumns = struct {
	ID      string
	Content string
	UserID  string
}{
	ID:      "id",
	Content: "content",
	UserID:  "user_id",
}
View Source
var PostRels = struct {
	User     string
	Comments string
	Images   string
	Likes    string
}{
	User:     "User",
	Comments: "Comments",
	Images:   "Images",
	Likes:    "Likes",
}

PostRels is where relationship names are stored.

View Source
var PostWhere = struct {
	ID      whereHelperuint
	Content whereHelperstring
	UserID  whereHelperuint
}{
	ID:      whereHelperuint{/* contains filtered or unexported fields */},
	Content: whereHelperstring{/* contains filtered or unexported fields */},
	UserID:  whereHelperuint{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Comment           string
	CommentLike       string
	Friendship        string
	Image             string
	ImageVariation    string
	Like              string
	Post              string
	User              string
	UserHasFriendship string
}{
	Comment:           "comment",
	CommentLike:       "comment_like",
	Friendship:        "friendship",
	Image:             "image",
	ImageVariation:    "image_variation",
	Like:              "like",
	Post:              "post",
	User:              "user",
	UserHasFriendship: "user_has_friendship",
}
View Source
var UserColumns = struct {
	ID        string
	FirstName string
	LastName  string
	Email     string
	Password  string
}{
	ID:        "id",
	FirstName: "first_name",
	LastName:  "last_name",
	Email:     "email",
	Password:  "password",
}
View Source
var UserRels = struct {
	Comments     string
	CommentLikes string
	Likes        string
	Posts        string
	Friendships  string
}{
	Comments:     "Comments",
	CommentLikes: "CommentLikes",
	Likes:        "Likes",
	Posts:        "Posts",
	Friendships:  "Friendships",
}

UserRels is where relationship names are stored.

View Source
var UserWhere = struct {
	ID        whereHelperuint
	FirstName whereHelperstring
	LastName  whereHelperstring
	Email     whereHelperstring
	Password  whereHelper__byte
}{
	ID:        whereHelperuint{/* contains filtered or unexported fields */},
	FirstName: whereHelperstring{/* contains filtered or unexported fields */},
	LastName:  whereHelperstring{/* contains filtered or unexported fields */},
	Email:     whereHelperstring{/* contains filtered or unexported fields */},
	Password:  whereHelper__byte{/* contains filtered or unexported fields */},
}

Functions

func AddCommentHook

func AddCommentHook(hookPoint boil.HookPoint, commentHook CommentHook)

AddCommentHook registers your hook function for all future operations.

func AddCommentLikeHook

func AddCommentLikeHook(hookPoint boil.HookPoint, commentLikeHook CommentLikeHook)

AddCommentLikeHook registers your hook function for all future operations.

func AddFriendshipHook

func AddFriendshipHook(hookPoint boil.HookPoint, friendshipHook FriendshipHook)

AddFriendshipHook registers your hook function for all future operations.

func AddImageHook

func AddImageHook(hookPoint boil.HookPoint, imageHook ImageHook)

AddImageHook registers your hook function for all future operations.

func AddImageVariationHook

func AddImageVariationHook(hookPoint boil.HookPoint, imageVariationHook ImageVariationHook)

AddImageVariationHook registers your hook function for all future operations.

func AddLikeHook

func AddLikeHook(hookPoint boil.HookPoint, likeHook LikeHook)

AddLikeHook registers your hook function for all future operations.

func AddPostHook

func AddPostHook(hookPoint boil.HookPoint, postHook PostHook)

AddPostHook registers your hook function for all future operations.

func AddUserHook

func AddUserHook(hookPoint boil.HookPoint, userHook UserHook)

AddUserHook registers your hook function for all future operations.

func CommentExists

func CommentExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

CommentExists checks if the Comment row exists.

func CommentLikeExists

func CommentLikeExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

CommentLikeExists checks if the CommentLike row exists.

func CommentLikes

func CommentLikes(mods ...qm.QueryMod) commentLikeQuery

CommentLikes retrieves all the records using an executor.

func Comments

func Comments(mods ...qm.QueryMod) commentQuery

Comments retrieves all the records using an executor.

func FriendshipExists

func FriendshipExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

FriendshipExists checks if the Friendship row exists.

func Friendships

func Friendships(mods ...qm.QueryMod) friendshipQuery

Friendships retrieves all the records using an executor.

func ImageExists

func ImageExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

ImageExists checks if the Image row exists.

func ImageVariationExists

func ImageVariationExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

ImageVariationExists checks if the ImageVariation row exists.

func ImageVariations

func ImageVariations(mods ...qm.QueryMod) imageVariationQuery

ImageVariations retrieves all the records using an executor.

func Images

func Images(mods ...qm.QueryMod) imageQuery

Images retrieves all the records using an executor.

func LikeExists

func LikeExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

LikeExists checks if the Like row exists.

func Likes

func Likes(mods ...qm.QueryMod) likeQuery

Likes 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 PostExists

func PostExists(ctx context.Context, exec boil.ContextExecutor, iD uint) (bool, error)

PostExists checks if the Post row exists.

func Posts

func Posts(mods ...qm.QueryMod) postQuery

Posts retrieves all the records using an executor.

func UserExists

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

Types

type Comment

type Comment struct {
	ID      uint   `boil:"id" json:"id" toml:"id" yaml:"id"`
	Content string `boil:"content" json:"content" toml:"content" yaml:"content"`
	PostID  uint   `boil:"post_id" json:"post_id" toml:"post_id" yaml:"post_id"`
	UserID  uint   `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

	R *commentR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L commentL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Comment is an object representing the database table.

func FindComment

func FindComment(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Comment, error)

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

func (*Comment) AddCommentLikes

func (o *Comment) AddCommentLikes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*CommentLike) error

AddCommentLikes adds the given related objects to the existing relationships of the comment, optionally inserting them as new records. Appends related to o.R.CommentLikes. Sets related.R.Comment appropriately.

func (*Comment) CommentLikes

func (o *Comment) CommentLikes(mods ...qm.QueryMod) commentLikeQuery

CommentLikes retrieves all the comment_like's CommentLikes with an executor.

func (*Comment) Delete

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

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

func (o *Comment) 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 (*Comment) Post

func (o *Comment) Post(mods ...qm.QueryMod) postQuery

Post pointed to by the foreign key.

func (*Comment) Reload

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

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

func (*Comment) SetPost

func (o *Comment) SetPost(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Post) error

SetPost of the comment to the related item. Sets o.R.Post to related. Adds o to related.R.Comments.

func (*Comment) SetUser

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

SetUser of the comment to the related item. Sets o.R.User to related. Adds o to related.R.Comments.

func (*Comment) Update

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

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

func (o *Comment) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 (*Comment) User

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

User pointed to by the foreign key.

type CommentHook

type CommentHook func(context.Context, boil.ContextExecutor, *Comment) error

CommentHook is the signature for custom Comment hook methods

type CommentLike

type CommentLike struct {
	ID        uint      `boil:"id" json:"id" toml:"id" yaml:"id"`
	CommentID uint      `boil:"comment_id" json:"comment_id" toml:"comment_id" yaml:"comment_id"`
	UserID    uint      `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	LikeType  string    `boil:"like_type" json:"like_type" toml:"like_type" yaml:"like_type"`

	R *commentLikeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L commentLikeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

CommentLike is an object representing the database table.

func FindCommentLike

func FindCommentLike(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*CommentLike, error)

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

func (*CommentLike) Comment

func (o *CommentLike) Comment(mods ...qm.QueryMod) commentQuery

Comment pointed to by the foreign key.

func (*CommentLike) Delete

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

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

func (*CommentLike) Insert

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

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

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

func (*CommentLike) SetComment

func (o *CommentLike) SetComment(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Comment) error

SetComment of the commentLike to the related item. Sets o.R.Comment to related. Adds o to related.R.CommentLikes.

func (*CommentLike) SetUser

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

SetUser of the commentLike to the related item. Sets o.R.User to related. Adds o to related.R.CommentLikes.

func (*CommentLike) Update

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

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

func (o *CommentLike) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 (*CommentLike) User

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

User pointed to by the foreign key.

type CommentLikeHook

type CommentLikeHook func(context.Context, boil.ContextExecutor, *CommentLike) error

CommentLikeHook is the signature for custom CommentLike hook methods

type CommentLikeSlice

type CommentLikeSlice []*CommentLike

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

func (CommentLikeSlice) DeleteAll

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

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

func (*CommentLikeSlice) ReloadAll

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

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

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

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

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

func (*CommentSlice) ReloadAll

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

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

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

type Friendship

type Friendship struct {
	ID        uint      `boil:"id" json:"id" toml:"id" yaml:"id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`

	R *friendshipR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L friendshipL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Friendship is an object representing the database table.

func FindFriendship

func FindFriendship(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Friendship, error)

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

func (*Friendship) AddUsers

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

AddUsers adds the given related objects to the existing relationships of the friendship, optionally inserting them as new records. Appends related to o.R.Users. Sets related.R.Friendships appropriately.

func (*Friendship) Delete

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

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

func (*Friendship) Insert

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

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

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

func (*Friendship) RemoveUsers

func (o *Friendship) RemoveUsers(ctx context.Context, exec boil.ContextExecutor, related ...*User) error

RemoveUsers relationships from objects passed in. Removes related items from R.Users (uses pointer comparison, removal does not keep order) Sets related.R.Friendships.

func (*Friendship) SetUsers

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

SetUsers removes all previously related items of the friendship replacing them completely with the passed in related items, optionally inserting them as new records. Sets o.R.Friendships's Users accordingly. Replaces o.R.Users with related. Sets related.R.Friendships's Users accordingly.

func (*Friendship) Update

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

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

func (o *Friendship) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 (*Friendship) Users

func (o *Friendship) Users(mods ...qm.QueryMod) userQuery

Users retrieves all the user's Users with an executor.

type FriendshipHook

type FriendshipHook func(context.Context, boil.ContextExecutor, *Friendship) error

FriendshipHook is the signature for custom Friendship hook methods

type FriendshipSlice

type FriendshipSlice []*Friendship

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

func (FriendshipSlice) DeleteAll

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

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

func (*FriendshipSlice) ReloadAll

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

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

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

type Image

type Image struct {
	ID          uint        `boil:"id" json:"id" toml:"id" yaml:"id"`
	PostID      uint        `boil:"post_id" json:"post_id" toml:"post_id" yaml:"post_id"`
	Views       null.Int    `boil:"views" json:"views,omitempty" toml:"views" yaml:"views,omitempty"`
	OriginalURL null.String `boil:"original_url" json:"original_url,omitempty" toml:"original_url" yaml:"original_url,omitempty"`

	R *imageR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L imageL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Image is an object representing the database table.

func FindImage

func FindImage(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Image, error)

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

func (*Image) AddImageVariations

func (o *Image) AddImageVariations(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*ImageVariation) error

AddImageVariations adds the given related objects to the existing relationships of the image, optionally inserting them as new records. Appends related to o.R.ImageVariations. Sets related.R.Image appropriately.

func (*Image) Delete

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

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

func (*Image) ImageVariations

func (o *Image) ImageVariations(mods ...qm.QueryMod) imageVariationQuery

ImageVariations retrieves all the image_variation's ImageVariations with an executor.

func (*Image) Insert

func (o *Image) 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 (*Image) Post

func (o *Image) Post(mods ...qm.QueryMod) postQuery

Post pointed to by the foreign key.

func (*Image) Reload

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

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

func (*Image) SetPost

func (o *Image) SetPost(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Post) error

SetPost of the image to the related item. Sets o.R.Post to related. Adds o to related.R.Images.

func (*Image) Update

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

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

func (o *Image) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ImageHook

type ImageHook func(context.Context, boil.ContextExecutor, *Image) error

ImageHook is the signature for custom Image hook methods

type ImageSlice

type ImageSlice []*Image

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

func (ImageSlice) DeleteAll

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

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

func (*ImageSlice) ReloadAll

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

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

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

type ImageVariation

type ImageVariation struct {
	ID      uint `boil:"id" json:"id" toml:"id" yaml:"id"`
	ImageID uint `boil:"image_id" json:"image_id" toml:"image_id" yaml:"image_id"`

	R *imageVariationR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L imageVariationL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

ImageVariation is an object representing the database table.

func FindImageVariation

func FindImageVariation(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*ImageVariation, error)

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

func (*ImageVariation) Delete

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

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

func (*ImageVariation) Image

func (o *ImageVariation) Image(mods ...qm.QueryMod) imageQuery

Image pointed to by the foreign key.

func (*ImageVariation) Insert

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

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

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

func (*ImageVariation) SetImage

func (o *ImageVariation) SetImage(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Image) error

SetImage of the imageVariation to the related item. Sets o.R.Image to related. Adds o to related.R.ImageVariations.

func (*ImageVariation) Update

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

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

func (o *ImageVariation) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 ImageVariationHook

type ImageVariationHook func(context.Context, boil.ContextExecutor, *ImageVariation) error

ImageVariationHook is the signature for custom ImageVariation hook methods

type ImageVariationSlice

type ImageVariationSlice []*ImageVariation

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

func (ImageVariationSlice) DeleteAll

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

func (*ImageVariationSlice) ReloadAll

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

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

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

type Like

type Like struct {
	ID        uint      `boil:"id" json:"id" toml:"id" yaml:"id"`
	PostID    uint      `boil:"post_id" json:"post_id" toml:"post_id" yaml:"post_id"`
	UserID    uint      `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`
	CreatedAt null.Time `boil:"created_at" json:"created_at,omitempty" toml:"created_at" yaml:"created_at,omitempty"`
	LikeType  string    `boil:"like_type" json:"like_type" toml:"like_type" yaml:"like_type"`

	R *likeR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L likeL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Like is an object representing the database table.

func FindLike

func FindLike(ctx context.Context, exec boil.ContextExecutor, iD uint, selectCols ...string) (*Like, error)

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

func (*Like) Delete

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

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

func (*Like) Insert

func (o *Like) 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 (*Like) Post

func (o *Like) Post(mods ...qm.QueryMod) postQuery

Post pointed to by the foreign key.

func (*Like) Reload

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

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

func (*Like) SetPost

func (o *Like) SetPost(ctx context.Context, exec boil.ContextExecutor, insert bool, related *Post) error

SetPost of the like to the related item. Sets o.R.Post to related. Adds o to related.R.Likes.

func (*Like) SetUser

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

SetUser of the like to the related item. Sets o.R.User to related. Adds o to related.R.Likes.

func (*Like) Update

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

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

func (o *Like) Upsert(ctx context.Context, exec boil.ContextExecutor, 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 (*Like) User

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

User pointed to by the foreign key.

type LikeHook

type LikeHook func(context.Context, boil.ContextExecutor, *Like) error

LikeHook is the signature for custom Like hook methods

type LikeSlice

type LikeSlice []*Like

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

func (LikeSlice) DeleteAll

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

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

func (*LikeSlice) ReloadAll

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

func (o LikeSlice) 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      uint   `boil:"id" json:"id" toml:"id" yaml:"id"`
	Content string `boil:"content" json:"content" toml:"content" yaml:"content"`
	UserID  uint   `boil:"user_id" json:"user_id" toml:"user_id" yaml:"user_id"`

	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 uint, 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) AddComments

func (o *Post) AddComments(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Comment) error

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

func (o *Post) AddImages(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Image) error

AddImages adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Images. Sets related.R.Post appropriately.

func (*Post) AddLikes

func (o *Post) AddLikes(ctx context.Context, exec boil.ContextExecutor, insert bool, related ...*Like) error

AddLikes adds the given related objects to the existing relationships of the post, optionally inserting them as new records. Appends related to o.R.Likes. Sets related.R.Post appropriately.

func (*Post) Comments

func (o *Post) Comments(mods ...qm.QueryMod) commentQuery

Comments retrieves all the comment's Comments with an executor.

func (*Post) Delete

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

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

func (o *Post) Images(mods ...qm.QueryMod) imageQuery

Images retrieves all the image's Images with an executor.

func (*Post) Insert

func (o *Post) 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 (*Post) Likes

func (o *Post) Likes(mods ...qm.QueryMod) likeQuery

Likes retrieves all the like's Likes with an executor.

func (*Post) Reload

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

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, 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 (*Post) User

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

User pointed to by the foreign key.

type PostHook

type PostHook func(context.Context, boil.ContextExecutor, *Post) error

PostHook is the signature for custom Post hook methods

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

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

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

func (*PostSlice) ReloadAll

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

func (o PostSlice) 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        uint   `boil:"id" json:"id" toml:"id" yaml:"id"`
	FirstName string `boil:"first_name" json:"first_name" toml:"first_name" yaml:"first_name"`
	LastName  string `boil:"last_name" json:"last_name" toml:"last_name" yaml:"last_name"`
	Email     string `boil:"email" json:"email" toml:"email" yaml:"email"`
	Password  []byte `boil:"password" json:"password" toml:"password" yaml:"password"`

	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 uint, 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) AddCommentLikes

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

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

func (*User) AddComments

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

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

func (*User) AddFriendships

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

AddFriendships adds the given related objects to the existing relationships of the user, optionally inserting them as new records. Appends related to o.R.Friendships. Sets related.R.Users appropriately.

func (*User) AddLikes

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

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

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

func (o *User) CommentLikes(mods ...qm.QueryMod) commentLikeQuery

CommentLikes retrieves all the comment_like's CommentLikes with an executor.

func (*User) Comments

func (o *User) Comments(mods ...qm.QueryMod) commentQuery

Comments retrieves all the comment's Comments 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) Friendships

func (o *User) Friendships(mods ...qm.QueryMod) friendshipQuery

Friendships retrieves all the friendship's Friendships 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) Likes

func (o *User) Likes(mods ...qm.QueryMod) likeQuery

Likes retrieves all the like's Likes with an executor.

func (*User) Posts

func (o *User) Posts(mods ...qm.QueryMod) postQuery

Posts retrieves all the post's Posts with an executor.

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

func (o *User) RemoveFriendships(ctx context.Context, exec boil.ContextExecutor, related ...*Friendship) error

RemoveFriendships relationships from objects passed in. Removes related items from R.Friendships (uses pointer comparison, removal does not keep order) Sets related.R.Users.

func (*User) SetFriendships

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

SetFriendships 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.Users's Friendships accordingly. Replaces o.R.Friendships with related. Sets related.R.Users's Friendships 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, 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 UserHook

type UserHook func(context.Context, boil.ContextExecutor, *User) error

UserHook is the signature for custom User hook methods

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL