test

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

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

Go to latest
Published: Nov 3, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BlogDBSchema = struct {
	ID        blogDBSchemaField
	CreatedAt blogDBSchemaField
	UpdatedAt blogDBSchemaField
	DeletedAt blogDBSchemaField
	Name      blogDBSchemaField
}{

	ID:        blogDBSchemaField("id"),
	CreatedAt: blogDBSchemaField("created_at"),
	UpdatedAt: blogDBSchemaField("updated_at"),
	DeletedAt: blogDBSchemaField("deleted_at"),
	Name:      blogDBSchemaField("myname"),
}

BlogDBSchema stores db field names of Blog

View Source
var CheckReservedKeywordsDBSchema = struct {
	Type   checkReservedKeywordsDBSchemaField
	Struct checkReservedKeywordsDBSchemaField
}{

	Type:   checkReservedKeywordsDBSchemaField("type"),
	Struct: checkReservedKeywordsDBSchemaField("struct"),
}

CheckReservedKeywordsDBSchema stores db field names of CheckReservedKeywords

View Source
var PostDBSchema = struct {
	ID        postDBSchemaField
	CreatedAt postDBSchemaField
	UpdatedAt postDBSchemaField
	DeletedAt postDBSchemaField
	Blog      postDBSchemaField
	User      postDBSchemaField
	Title     postDBSchemaField
	Str       postDBSchemaField
}{

	ID:        postDBSchemaField("id"),
	CreatedAt: postDBSchemaField("created_at"),
	UpdatedAt: postDBSchemaField("updated_at"),
	DeletedAt: postDBSchemaField("deleted_at"),
	Blog:      postDBSchemaField("blog"),
	User:      postDBSchemaField("user"),
	Title:     postDBSchemaField("title"),
	Str:       postDBSchemaField("str"),
}

PostDBSchema stores db field names of Post

View Source
var UserDBSchema = struct {
	ID        userDBSchemaField
	CreatedAt userDBSchemaField
	UpdatedAt userDBSchemaField
	DeletedAt userDBSchemaField
	Name      userDBSchemaField
	Email     userDBSchemaField
}{

	ID:        userDBSchemaField("id"),
	CreatedAt: userDBSchemaField("created_at"),
	UpdatedAt: userDBSchemaField("updated_at"),
	DeletedAt: userDBSchemaField("deleted_at"),
	Name:      userDBSchemaField("name"),
	Email:     userDBSchemaField("email"),
}

UserDBSchema stores db field names of User

Functions

This section is empty.

Types

type Blog

type Blog struct {
	gorm.Model

	Name string `gorm:"column:myname"`
}

Blog is a blog gen:qs

func (*Blog) Create

func (o *Blog) Create(db *gorm.DB) error

Create is an autogenerated method nolint: dupl

func (*Blog) Delete

func (o *Blog) Delete(db *gorm.DB) error

Delete is an autogenerated method nolint: dupl

func (*Blog) SomeMethod

func (b *Blog) SomeMethod() string

SomeMethod is just for testing purposes

func (*Blog) Update

func (o *Blog) Update(db *gorm.DB, fields ...blogDBSchemaField) error

Update updates Blog fields by primary key

type BlogQuerySet

type BlogQuerySet struct {
	// contains filtered or unexported fields
}

BlogQuerySet is an queryset type for Blog

func NewBlogQuerySet

func NewBlogQuerySet(db *gorm.DB) BlogQuerySet

NewBlogQuerySet constructs new BlogQuerySet

func (BlogQuerySet) All

func (qs BlogQuerySet) All(ret *[]Blog) error

All is an autogenerated method nolint: dupl

func (BlogQuerySet) Count

func (qs BlogQuerySet) Count() (int, error)

Count is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtEq

func (qs BlogQuerySet) CreatedAtEq(createdAt time.Time) BlogQuerySet

CreatedAtEq is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtGt

func (qs BlogQuerySet) CreatedAtGt(createdAt time.Time) BlogQuerySet

CreatedAtGt is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtGte

func (qs BlogQuerySet) CreatedAtGte(createdAt time.Time) BlogQuerySet

CreatedAtGte is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtLt

func (qs BlogQuerySet) CreatedAtLt(createdAt time.Time) BlogQuerySet

CreatedAtLt is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtLte

func (qs BlogQuerySet) CreatedAtLte(createdAt time.Time) BlogQuerySet

CreatedAtLte is an autogenerated method nolint: dupl

func (BlogQuerySet) CreatedAtNe

func (qs BlogQuerySet) CreatedAtNe(createdAt time.Time) BlogQuerySet

CreatedAtNe is an autogenerated method nolint: dupl

func (BlogQuerySet) Delete

func (qs BlogQuerySet) Delete() error

Delete is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtEq

func (qs BlogQuerySet) DeletedAtEq(deletedAt time.Time) BlogQuerySet

DeletedAtEq is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtGt

func (qs BlogQuerySet) DeletedAtGt(deletedAt time.Time) BlogQuerySet

DeletedAtGt is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtGte

func (qs BlogQuerySet) DeletedAtGte(deletedAt time.Time) BlogQuerySet

DeletedAtGte is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtIsNotNull

func (qs BlogQuerySet) DeletedAtIsNotNull() BlogQuerySet

DeletedAtIsNotNull is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtIsNull

func (qs BlogQuerySet) DeletedAtIsNull() BlogQuerySet

DeletedAtIsNull is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtLt

func (qs BlogQuerySet) DeletedAtLt(deletedAt time.Time) BlogQuerySet

DeletedAtLt is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtLte

func (qs BlogQuerySet) DeletedAtLte(deletedAt time.Time) BlogQuerySet

DeletedAtLte is an autogenerated method nolint: dupl

func (BlogQuerySet) DeletedAtNe

func (qs BlogQuerySet) DeletedAtNe(deletedAt time.Time) BlogQuerySet

DeletedAtNe is an autogenerated method nolint: dupl

func (BlogQuerySet) GetUpdater

func (qs BlogQuerySet) GetUpdater() BlogUpdater

GetUpdater is an autogenerated method nolint: dupl

func (BlogQuerySet) IDEq

func (qs BlogQuerySet) IDEq(ID uint) BlogQuerySet

IDEq is an autogenerated method nolint: dupl

func (BlogQuerySet) IDGt

func (qs BlogQuerySet) IDGt(ID uint) BlogQuerySet

IDGt is an autogenerated method nolint: dupl

func (BlogQuerySet) IDGte

func (qs BlogQuerySet) IDGte(ID uint) BlogQuerySet

IDGte is an autogenerated method nolint: dupl

func (BlogQuerySet) IDIn

func (qs BlogQuerySet) IDIn(ID uint, IDRest ...uint) BlogQuerySet

IDIn is an autogenerated method nolint: dupl

func (BlogQuerySet) IDLt

func (qs BlogQuerySet) IDLt(ID uint) BlogQuerySet

IDLt is an autogenerated method nolint: dupl

func (BlogQuerySet) IDLte

func (qs BlogQuerySet) IDLte(ID uint) BlogQuerySet

IDLte is an autogenerated method nolint: dupl

func (BlogQuerySet) IDNe

func (qs BlogQuerySet) IDNe(ID uint) BlogQuerySet

IDNe is an autogenerated method nolint: dupl

func (BlogQuerySet) IDNotIn

func (qs BlogQuerySet) IDNotIn(ID uint, IDRest ...uint) BlogQuerySet

IDNotIn is an autogenerated method nolint: dupl

func (BlogQuerySet) Limit

func (qs BlogQuerySet) Limit(limit int) BlogQuerySet

Limit is an autogenerated method nolint: dupl

func (BlogQuerySet) NameEq

func (qs BlogQuerySet) NameEq(name string) BlogQuerySet

NameEq is an autogenerated method nolint: dupl

func (BlogQuerySet) NameIn

func (qs BlogQuerySet) NameIn(name string, nameRest ...string) BlogQuerySet

NameIn is an autogenerated method nolint: dupl

func (BlogQuerySet) NameNe

func (qs BlogQuerySet) NameNe(name string) BlogQuerySet

NameNe is an autogenerated method nolint: dupl

func (BlogQuerySet) NameNotIn

func (qs BlogQuerySet) NameNotIn(name string, nameRest ...string) BlogQuerySet

NameNotIn is an autogenerated method nolint: dupl

func (BlogQuerySet) One

func (qs BlogQuerySet) One(ret *Blog) error

One is used to retrieve one result. It returns gorm.ErrRecordNotFound if nothing was fetched

func (BlogQuerySet) OrderAscByCreatedAt

func (qs BlogQuerySet) OrderAscByCreatedAt() BlogQuerySet

OrderAscByCreatedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderAscByDeletedAt

func (qs BlogQuerySet) OrderAscByDeletedAt() BlogQuerySet

OrderAscByDeletedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderAscByID

func (qs BlogQuerySet) OrderAscByID() BlogQuerySet

OrderAscByID is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderAscByUpdatedAt

func (qs BlogQuerySet) OrderAscByUpdatedAt() BlogQuerySet

OrderAscByUpdatedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderDescByCreatedAt

func (qs BlogQuerySet) OrderDescByCreatedAt() BlogQuerySet

OrderDescByCreatedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderDescByDeletedAt

func (qs BlogQuerySet) OrderDescByDeletedAt() BlogQuerySet

OrderDescByDeletedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderDescByID

func (qs BlogQuerySet) OrderDescByID() BlogQuerySet

OrderDescByID is an autogenerated method nolint: dupl

func (BlogQuerySet) OrderDescByUpdatedAt

func (qs BlogQuerySet) OrderDescByUpdatedAt() BlogQuerySet

OrderDescByUpdatedAt is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtEq

func (qs BlogQuerySet) UpdatedAtEq(updatedAt time.Time) BlogQuerySet

UpdatedAtEq is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtGt

func (qs BlogQuerySet) UpdatedAtGt(updatedAt time.Time) BlogQuerySet

UpdatedAtGt is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtGte

func (qs BlogQuerySet) UpdatedAtGte(updatedAt time.Time) BlogQuerySet

UpdatedAtGte is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtLt

func (qs BlogQuerySet) UpdatedAtLt(updatedAt time.Time) BlogQuerySet

UpdatedAtLt is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtLte

func (qs BlogQuerySet) UpdatedAtLte(updatedAt time.Time) BlogQuerySet

UpdatedAtLte is an autogenerated method nolint: dupl

func (BlogQuerySet) UpdatedAtNe

func (qs BlogQuerySet) UpdatedAtNe(updatedAt time.Time) BlogQuerySet

UpdatedAtNe is an autogenerated method nolint: dupl

type BlogUpdater

type BlogUpdater struct {
	// contains filtered or unexported fields
}

BlogUpdater is an Blog updates manager

func NewBlogUpdater

func NewBlogUpdater(db *gorm.DB) BlogUpdater

NewBlogUpdater creates new Blog updater

func (BlogUpdater) SetCreatedAt

func (u BlogUpdater) SetCreatedAt(createdAt time.Time) BlogUpdater

SetCreatedAt is an autogenerated method nolint: dupl

func (BlogUpdater) SetDeletedAt

func (u BlogUpdater) SetDeletedAt(deletedAt *time.Time) BlogUpdater

SetDeletedAt is an autogenerated method nolint: dupl

func (BlogUpdater) SetID

func (u BlogUpdater) SetID(ID uint) BlogUpdater

SetID is an autogenerated method nolint: dupl

func (BlogUpdater) SetName

func (u BlogUpdater) SetName(name string) BlogUpdater

SetName is an autogenerated method nolint: dupl

func (BlogUpdater) SetUpdatedAt

func (u BlogUpdater) SetUpdatedAt(updatedAt time.Time) BlogUpdater

SetUpdatedAt is an autogenerated method nolint: dupl

func (BlogUpdater) Update

func (u BlogUpdater) Update() error

Update is an autogenerated method nolint: dupl

func (BlogUpdater) UpdateNum

func (u BlogUpdater) UpdateNum() (int64, error)

UpdateNum is an autogenerated method nolint: dupl

type CheckReservedKeywords

type CheckReservedKeywords struct {
	Type   string
	Struct int
}

CheckReservedKeywords is a struct for checking work of fields with reserved keywords names gen:qs

func (*CheckReservedKeywords) Create

func (o *CheckReservedKeywords) Create(db *gorm.DB) error

Create is an autogenerated method nolint: dupl

func (*CheckReservedKeywords) Delete

func (o *CheckReservedKeywords) Delete(db *gorm.DB) error

Delete is an autogenerated method nolint: dupl

func (*CheckReservedKeywords) Update

func (o *CheckReservedKeywords) Update(db *gorm.DB, fields ...checkReservedKeywordsDBSchemaField) error

Update updates CheckReservedKeywords fields by primary key

type CheckReservedKeywordsQuerySet

type CheckReservedKeywordsQuerySet struct {
	// contains filtered or unexported fields
}

CheckReservedKeywordsQuerySet is an queryset type for CheckReservedKeywords

func NewCheckReservedKeywordsQuerySet

func NewCheckReservedKeywordsQuerySet(db *gorm.DB) CheckReservedKeywordsQuerySet

NewCheckReservedKeywordsQuerySet constructs new CheckReservedKeywordsQuerySet

func (CheckReservedKeywordsQuerySet) All

All is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) Count

func (qs CheckReservedKeywordsQuerySet) Count() (int, error)

Count is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) Delete

Delete is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) GetUpdater

GetUpdater is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) Limit

Limit is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) One

One is used to retrieve one result. It returns gorm.ErrRecordNotFound if nothing was fetched

func (CheckReservedKeywordsQuerySet) OrderAscByStruct

OrderAscByStruct is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) OrderDescByStruct

OrderDescByStruct is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructEq

StructEq is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructGt

StructGt is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructGte

StructGte is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructIn

func (qs CheckReservedKeywordsQuerySet) StructIn(structValue int, structValueRest ...int) CheckReservedKeywordsQuerySet

StructIn is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructLt

StructLt is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructLte

StructLte is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructNe

StructNe is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) StructNotIn

func (qs CheckReservedKeywordsQuerySet) StructNotIn(structValue int, structValueRest ...int) CheckReservedKeywordsQuerySet

StructNotIn is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) TypeEq

TypeEq is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) TypeIn

func (qs CheckReservedKeywordsQuerySet) TypeIn(typeValue string, typeValueRest ...string) CheckReservedKeywordsQuerySet

TypeIn is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) TypeNe

TypeNe is an autogenerated method nolint: dupl

func (CheckReservedKeywordsQuerySet) TypeNotIn

func (qs CheckReservedKeywordsQuerySet) TypeNotIn(typeValue string, typeValueRest ...string) CheckReservedKeywordsQuerySet

TypeNotIn is an autogenerated method nolint: dupl

type CheckReservedKeywordsUpdater

type CheckReservedKeywordsUpdater struct {
	// contains filtered or unexported fields
}

CheckReservedKeywordsUpdater is an CheckReservedKeywords updates manager

func NewCheckReservedKeywordsUpdater

func NewCheckReservedKeywordsUpdater(db *gorm.DB) CheckReservedKeywordsUpdater

NewCheckReservedKeywordsUpdater creates new CheckReservedKeywords updater

func (CheckReservedKeywordsUpdater) SetStruct

SetStruct is an autogenerated method nolint: dupl

func (CheckReservedKeywordsUpdater) SetType

SetType is an autogenerated method nolint: dupl

func (CheckReservedKeywordsUpdater) Update

Update is an autogenerated method nolint: dupl

func (CheckReservedKeywordsUpdater) UpdateNum

func (u CheckReservedKeywordsUpdater) UpdateNum() (int64, error)

UpdateNum is an autogenerated method nolint: dupl

type Post

type Post struct {
	gorm.Model

	Blog   *Blog // may be no blog
	User   User
	Title  *string
	Str    tmp.StringDef
	Unused int `gorm:"-"`
}

Post is an article gen:qs

func (*Post) Create

func (o *Post) Create(db *gorm.DB) error

Create is an autogenerated method nolint: dupl

func (*Post) Delete

func (o *Post) Delete(db *gorm.DB) error

Delete is an autogenerated method nolint: dupl

func (*Post) String

func (p *Post) String() string

String is just for testing purposes

func (*Post) Update

func (o *Post) Update(db *gorm.DB, fields ...postDBSchemaField) error

Update updates Post fields by primary key

type PostQuerySet

type PostQuerySet struct {
	// contains filtered or unexported fields
}

PostQuerySet is an queryset type for Post

func NewPostQuerySet

func NewPostQuerySet(db *gorm.DB) PostQuerySet

NewPostQuerySet constructs new PostQuerySet

func (PostQuerySet) All

func (qs PostQuerySet) All(ret *[]Post) error

All is an autogenerated method nolint: dupl

func (PostQuerySet) BlogIsNotNull

func (qs PostQuerySet) BlogIsNotNull() PostQuerySet

BlogIsNotNull is an autogenerated method nolint: dupl

func (PostQuerySet) BlogIsNull

func (qs PostQuerySet) BlogIsNull() PostQuerySet

BlogIsNull is an autogenerated method nolint: dupl

func (PostQuerySet) Count

func (qs PostQuerySet) Count() (int, error)

Count is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtEq

func (qs PostQuerySet) CreatedAtEq(createdAt time.Time) PostQuerySet

CreatedAtEq is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtGt

func (qs PostQuerySet) CreatedAtGt(createdAt time.Time) PostQuerySet

CreatedAtGt is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtGte

func (qs PostQuerySet) CreatedAtGte(createdAt time.Time) PostQuerySet

CreatedAtGte is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtLt

func (qs PostQuerySet) CreatedAtLt(createdAt time.Time) PostQuerySet

CreatedAtLt is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtLte

func (qs PostQuerySet) CreatedAtLte(createdAt time.Time) PostQuerySet

CreatedAtLte is an autogenerated method nolint: dupl

func (PostQuerySet) CreatedAtNe

func (qs PostQuerySet) CreatedAtNe(createdAt time.Time) PostQuerySet

CreatedAtNe is an autogenerated method nolint: dupl

func (PostQuerySet) Delete

func (qs PostQuerySet) Delete() error

Delete is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtEq

func (qs PostQuerySet) DeletedAtEq(deletedAt time.Time) PostQuerySet

DeletedAtEq is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtGt

func (qs PostQuerySet) DeletedAtGt(deletedAt time.Time) PostQuerySet

DeletedAtGt is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtGte

func (qs PostQuerySet) DeletedAtGte(deletedAt time.Time) PostQuerySet

DeletedAtGte is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtIsNotNull

func (qs PostQuerySet) DeletedAtIsNotNull() PostQuerySet

DeletedAtIsNotNull is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtIsNull

func (qs PostQuerySet) DeletedAtIsNull() PostQuerySet

DeletedAtIsNull is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtLt

func (qs PostQuerySet) DeletedAtLt(deletedAt time.Time) PostQuerySet

DeletedAtLt is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtLte

func (qs PostQuerySet) DeletedAtLte(deletedAt time.Time) PostQuerySet

DeletedAtLte is an autogenerated method nolint: dupl

func (PostQuerySet) DeletedAtNe

func (qs PostQuerySet) DeletedAtNe(deletedAt time.Time) PostQuerySet

DeletedAtNe is an autogenerated method nolint: dupl

func (PostQuerySet) GetUpdater

func (qs PostQuerySet) GetUpdater() PostUpdater

GetUpdater is an autogenerated method nolint: dupl

func (PostQuerySet) IDEq

func (qs PostQuerySet) IDEq(ID uint) PostQuerySet

IDEq is an autogenerated method nolint: dupl

func (PostQuerySet) IDGt

func (qs PostQuerySet) IDGt(ID uint) PostQuerySet

IDGt is an autogenerated method nolint: dupl

func (PostQuerySet) IDGte

func (qs PostQuerySet) IDGte(ID uint) PostQuerySet

IDGte is an autogenerated method nolint: dupl

func (PostQuerySet) IDIn

func (qs PostQuerySet) IDIn(ID uint, IDRest ...uint) PostQuerySet

IDIn is an autogenerated method nolint: dupl

func (PostQuerySet) IDLt

func (qs PostQuerySet) IDLt(ID uint) PostQuerySet

IDLt is an autogenerated method nolint: dupl

func (PostQuerySet) IDLte

func (qs PostQuerySet) IDLte(ID uint) PostQuerySet

IDLte is an autogenerated method nolint: dupl

func (PostQuerySet) IDNe

func (qs PostQuerySet) IDNe(ID uint) PostQuerySet

IDNe is an autogenerated method nolint: dupl

func (PostQuerySet) IDNotIn

func (qs PostQuerySet) IDNotIn(ID uint, IDRest ...uint) PostQuerySet

IDNotIn is an autogenerated method nolint: dupl

func (PostQuerySet) Limit

func (qs PostQuerySet) Limit(limit int) PostQuerySet

Limit is an autogenerated method nolint: dupl

func (PostQuerySet) One

func (qs PostQuerySet) One(ret *Post) error

One is used to retrieve one result. It returns gorm.ErrRecordNotFound if nothing was fetched

func (PostQuerySet) OrderAscByCreatedAt

func (qs PostQuerySet) OrderAscByCreatedAt() PostQuerySet

OrderAscByCreatedAt is an autogenerated method nolint: dupl

func (PostQuerySet) OrderAscByDeletedAt

func (qs PostQuerySet) OrderAscByDeletedAt() PostQuerySet

OrderAscByDeletedAt is an autogenerated method nolint: dupl

func (PostQuerySet) OrderAscByID

func (qs PostQuerySet) OrderAscByID() PostQuerySet

OrderAscByID is an autogenerated method nolint: dupl

func (PostQuerySet) OrderAscByUpdatedAt

func (qs PostQuerySet) OrderAscByUpdatedAt() PostQuerySet

OrderAscByUpdatedAt is an autogenerated method nolint: dupl

func (PostQuerySet) OrderDescByCreatedAt

func (qs PostQuerySet) OrderDescByCreatedAt() PostQuerySet

OrderDescByCreatedAt is an autogenerated method nolint: dupl

func (PostQuerySet) OrderDescByDeletedAt

func (qs PostQuerySet) OrderDescByDeletedAt() PostQuerySet

OrderDescByDeletedAt is an autogenerated method nolint: dupl

func (PostQuerySet) OrderDescByID

func (qs PostQuerySet) OrderDescByID() PostQuerySet

OrderDescByID is an autogenerated method nolint: dupl

func (PostQuerySet) OrderDescByUpdatedAt

func (qs PostQuerySet) OrderDescByUpdatedAt() PostQuerySet

OrderDescByUpdatedAt is an autogenerated method nolint: dupl

func (PostQuerySet) PreloadBlog

func (qs PostQuerySet) PreloadBlog() PostQuerySet

PreloadBlog is an autogenerated method nolint: dupl

func (PostQuerySet) PreloadUser

func (qs PostQuerySet) PreloadUser() PostQuerySet

PreloadUser is an autogenerated method nolint: dupl

func (PostQuerySet) StrEq

func (qs PostQuerySet) StrEq(str tmp.StringDef) PostQuerySet

StrEq is an autogenerated method nolint: dupl

func (PostQuerySet) StrIn

func (qs PostQuerySet) StrIn(str tmp.StringDef, strRest ...tmp.StringDef) PostQuerySet

StrIn is an autogenerated method nolint: dupl

func (PostQuerySet) StrNe

func (qs PostQuerySet) StrNe(str tmp.StringDef) PostQuerySet

StrNe is an autogenerated method nolint: dupl

func (PostQuerySet) StrNotIn

func (qs PostQuerySet) StrNotIn(str tmp.StringDef, strRest ...tmp.StringDef) PostQuerySet

StrNotIn is an autogenerated method nolint: dupl

func (PostQuerySet) TitleEq

func (qs PostQuerySet) TitleEq(title string) PostQuerySet

TitleEq is an autogenerated method nolint: dupl

func (PostQuerySet) TitleIn

func (qs PostQuerySet) TitleIn(title string, titleRest ...string) PostQuerySet

TitleIn is an autogenerated method nolint: dupl

func (PostQuerySet) TitleIsNotNull

func (qs PostQuerySet) TitleIsNotNull() PostQuerySet

TitleIsNotNull is an autogenerated method nolint: dupl

func (PostQuerySet) TitleIsNull

func (qs PostQuerySet) TitleIsNull() PostQuerySet

TitleIsNull is an autogenerated method nolint: dupl

func (PostQuerySet) TitleNe

func (qs PostQuerySet) TitleNe(title string) PostQuerySet

TitleNe is an autogenerated method nolint: dupl

func (PostQuerySet) TitleNotIn

func (qs PostQuerySet) TitleNotIn(title string, titleRest ...string) PostQuerySet

TitleNotIn is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtEq

func (qs PostQuerySet) UpdatedAtEq(updatedAt time.Time) PostQuerySet

UpdatedAtEq is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtGt

func (qs PostQuerySet) UpdatedAtGt(updatedAt time.Time) PostQuerySet

UpdatedAtGt is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtGte

func (qs PostQuerySet) UpdatedAtGte(updatedAt time.Time) PostQuerySet

UpdatedAtGte is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtLt

func (qs PostQuerySet) UpdatedAtLt(updatedAt time.Time) PostQuerySet

UpdatedAtLt is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtLte

func (qs PostQuerySet) UpdatedAtLte(updatedAt time.Time) PostQuerySet

UpdatedAtLte is an autogenerated method nolint: dupl

func (PostQuerySet) UpdatedAtNe

func (qs PostQuerySet) UpdatedAtNe(updatedAt time.Time) PostQuerySet

UpdatedAtNe is an autogenerated method nolint: dupl

type PostUpdater

type PostUpdater struct {
	// contains filtered or unexported fields
}

PostUpdater is an Post updates manager

func NewPostUpdater

func NewPostUpdater(db *gorm.DB) PostUpdater

NewPostUpdater creates new Post updater

func (PostUpdater) SetCreatedAt

func (u PostUpdater) SetCreatedAt(createdAt time.Time) PostUpdater

SetCreatedAt is an autogenerated method nolint: dupl

func (PostUpdater) SetDeletedAt

func (u PostUpdater) SetDeletedAt(deletedAt *time.Time) PostUpdater

SetDeletedAt is an autogenerated method nolint: dupl

func (PostUpdater) SetID

func (u PostUpdater) SetID(ID uint) PostUpdater

SetID is an autogenerated method nolint: dupl

func (PostUpdater) SetStr

func (u PostUpdater) SetStr(str tmp.StringDef) PostUpdater

SetStr is an autogenerated method nolint: dupl

func (PostUpdater) SetTitle

func (u PostUpdater) SetTitle(title *string) PostUpdater

SetTitle is an autogenerated method nolint: dupl

func (PostUpdater) SetUpdatedAt

func (u PostUpdater) SetUpdatedAt(updatedAt time.Time) PostUpdater

SetUpdatedAt is an autogenerated method nolint: dupl

func (PostUpdater) SetUser

func (u PostUpdater) SetUser(user User) PostUpdater

SetUser is an autogenerated method nolint: dupl

func (PostUpdater) Update

func (u PostUpdater) Update() error

Update is an autogenerated method nolint: dupl

func (PostUpdater) UpdateNum

func (u PostUpdater) UpdateNum() (int64, error)

UpdateNum is an autogenerated method nolint: dupl

type User

type User struct {
	gorm.Model

	//Posts []Post
	Name  string
	Email string
}

User is a usual user gen:qs

func (*User) Create

func (o *User) Create(db *gorm.DB) error

Create is an autogenerated method nolint: dupl

func (*User) Delete

func (o *User) Delete(db *gorm.DB) error

Delete is an autogenerated method nolint: dupl

func (*User) Update

func (o *User) Update(db *gorm.DB, fields ...userDBSchemaField) error

Update updates User fields by primary key

type UserQuerySet

type UserQuerySet struct {
	// contains filtered or unexported fields
}

UserQuerySet is an queryset type for User

func NewUserQuerySet

func NewUserQuerySet(db *gorm.DB) UserQuerySet

NewUserQuerySet constructs new UserQuerySet

func (UserQuerySet) All

func (qs UserQuerySet) All(ret *[]User) error

All is an autogenerated method nolint: dupl

func (UserQuerySet) Count

func (qs UserQuerySet) Count() (int, error)

Count is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtEq

func (qs UserQuerySet) CreatedAtEq(createdAt time.Time) UserQuerySet

CreatedAtEq is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtGt

func (qs UserQuerySet) CreatedAtGt(createdAt time.Time) UserQuerySet

CreatedAtGt is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtGte

func (qs UserQuerySet) CreatedAtGte(createdAt time.Time) UserQuerySet

CreatedAtGte is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtLt

func (qs UserQuerySet) CreatedAtLt(createdAt time.Time) UserQuerySet

CreatedAtLt is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtLte

func (qs UserQuerySet) CreatedAtLte(createdAt time.Time) UserQuerySet

CreatedAtLte is an autogenerated method nolint: dupl

func (UserQuerySet) CreatedAtNe

func (qs UserQuerySet) CreatedAtNe(createdAt time.Time) UserQuerySet

CreatedAtNe is an autogenerated method nolint: dupl

func (UserQuerySet) Delete

func (qs UserQuerySet) Delete() error

Delete is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtEq

func (qs UserQuerySet) DeletedAtEq(deletedAt time.Time) UserQuerySet

DeletedAtEq is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtGt

func (qs UserQuerySet) DeletedAtGt(deletedAt time.Time) UserQuerySet

DeletedAtGt is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtGte

func (qs UserQuerySet) DeletedAtGte(deletedAt time.Time) UserQuerySet

DeletedAtGte is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtIsNotNull

func (qs UserQuerySet) DeletedAtIsNotNull() UserQuerySet

DeletedAtIsNotNull is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtIsNull

func (qs UserQuerySet) DeletedAtIsNull() UserQuerySet

DeletedAtIsNull is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtLt

func (qs UserQuerySet) DeletedAtLt(deletedAt time.Time) UserQuerySet

DeletedAtLt is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtLte

func (qs UserQuerySet) DeletedAtLte(deletedAt time.Time) UserQuerySet

DeletedAtLte is an autogenerated method nolint: dupl

func (UserQuerySet) DeletedAtNe

func (qs UserQuerySet) DeletedAtNe(deletedAt time.Time) UserQuerySet

DeletedAtNe is an autogenerated method nolint: dupl

func (UserQuerySet) EmailEq

func (qs UserQuerySet) EmailEq(email string) UserQuerySet

EmailEq is an autogenerated method nolint: dupl

func (UserQuerySet) EmailIn

func (qs UserQuerySet) EmailIn(email string, emailRest ...string) UserQuerySet

EmailIn is an autogenerated method nolint: dupl

func (UserQuerySet) EmailNe

func (qs UserQuerySet) EmailNe(email string) UserQuerySet

EmailNe is an autogenerated method nolint: dupl

func (UserQuerySet) EmailNotIn

func (qs UserQuerySet) EmailNotIn(email string, emailRest ...string) UserQuerySet

EmailNotIn is an autogenerated method nolint: dupl

func (UserQuerySet) GetUpdater

func (qs UserQuerySet) GetUpdater() UserUpdater

GetUpdater is an autogenerated method nolint: dupl

func (UserQuerySet) IDEq

func (qs UserQuerySet) IDEq(ID uint) UserQuerySet

IDEq is an autogenerated method nolint: dupl

func (UserQuerySet) IDGt

func (qs UserQuerySet) IDGt(ID uint) UserQuerySet

IDGt is an autogenerated method nolint: dupl

func (UserQuerySet) IDGte

func (qs UserQuerySet) IDGte(ID uint) UserQuerySet

IDGte is an autogenerated method nolint: dupl

func (UserQuerySet) IDIn

func (qs UserQuerySet) IDIn(ID uint, IDRest ...uint) UserQuerySet

IDIn is an autogenerated method nolint: dupl

func (UserQuerySet) IDLt

func (qs UserQuerySet) IDLt(ID uint) UserQuerySet

IDLt is an autogenerated method nolint: dupl

func (UserQuerySet) IDLte

func (qs UserQuerySet) IDLte(ID uint) UserQuerySet

IDLte is an autogenerated method nolint: dupl

func (UserQuerySet) IDNe

func (qs UserQuerySet) IDNe(ID uint) UserQuerySet

IDNe is an autogenerated method nolint: dupl

func (UserQuerySet) IDNotIn

func (qs UserQuerySet) IDNotIn(ID uint, IDRest ...uint) UserQuerySet

IDNotIn is an autogenerated method nolint: dupl

func (UserQuerySet) Limit

func (qs UserQuerySet) Limit(limit int) UserQuerySet

Limit is an autogenerated method nolint: dupl

func (UserQuerySet) NameEq

func (qs UserQuerySet) NameEq(name string) UserQuerySet

NameEq is an autogenerated method nolint: dupl

func (UserQuerySet) NameIn

func (qs UserQuerySet) NameIn(name string, nameRest ...string) UserQuerySet

NameIn is an autogenerated method nolint: dupl

func (UserQuerySet) NameNe

func (qs UserQuerySet) NameNe(name string) UserQuerySet

NameNe is an autogenerated method nolint: dupl

func (UserQuerySet) NameNotIn

func (qs UserQuerySet) NameNotIn(name string, nameRest ...string) UserQuerySet

NameNotIn is an autogenerated method nolint: dupl

func (UserQuerySet) One

func (qs UserQuerySet) One(ret *User) error

One is used to retrieve one result. It returns gorm.ErrRecordNotFound if nothing was fetched

func (UserQuerySet) OrderAscByCreatedAt

func (qs UserQuerySet) OrderAscByCreatedAt() UserQuerySet

OrderAscByCreatedAt is an autogenerated method nolint: dupl

func (UserQuerySet) OrderAscByDeletedAt

func (qs UserQuerySet) OrderAscByDeletedAt() UserQuerySet

OrderAscByDeletedAt is an autogenerated method nolint: dupl

func (UserQuerySet) OrderAscByID

func (qs UserQuerySet) OrderAscByID() UserQuerySet

OrderAscByID is an autogenerated method nolint: dupl

func (UserQuerySet) OrderAscByUpdatedAt

func (qs UserQuerySet) OrderAscByUpdatedAt() UserQuerySet

OrderAscByUpdatedAt is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByCreatedAt

func (qs UserQuerySet) OrderDescByCreatedAt() UserQuerySet

OrderDescByCreatedAt is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByDeletedAt

func (qs UserQuerySet) OrderDescByDeletedAt() UserQuerySet

OrderDescByDeletedAt is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByID

func (qs UserQuerySet) OrderDescByID() UserQuerySet

OrderDescByID is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByUpdatedAt

func (qs UserQuerySet) OrderDescByUpdatedAt() UserQuerySet

OrderDescByUpdatedAt is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtEq

func (qs UserQuerySet) UpdatedAtEq(updatedAt time.Time) UserQuerySet

UpdatedAtEq is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtGt

func (qs UserQuerySet) UpdatedAtGt(updatedAt time.Time) UserQuerySet

UpdatedAtGt is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtGte

func (qs UserQuerySet) UpdatedAtGte(updatedAt time.Time) UserQuerySet

UpdatedAtGte is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtLt

func (qs UserQuerySet) UpdatedAtLt(updatedAt time.Time) UserQuerySet

UpdatedAtLt is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtLte

func (qs UserQuerySet) UpdatedAtLte(updatedAt time.Time) UserQuerySet

UpdatedAtLte is an autogenerated method nolint: dupl

func (UserQuerySet) UpdatedAtNe

func (qs UserQuerySet) UpdatedAtNe(updatedAt time.Time) UserQuerySet

UpdatedAtNe is an autogenerated method nolint: dupl

type UserUpdater

type UserUpdater struct {
	// contains filtered or unexported fields
}

UserUpdater is an User updates manager

func NewUserUpdater

func NewUserUpdater(db *gorm.DB) UserUpdater

NewUserUpdater creates new User updater

func (UserUpdater) SetCreatedAt

func (u UserUpdater) SetCreatedAt(createdAt time.Time) UserUpdater

SetCreatedAt is an autogenerated method nolint: dupl

func (UserUpdater) SetDeletedAt

func (u UserUpdater) SetDeletedAt(deletedAt *time.Time) UserUpdater

SetDeletedAt is an autogenerated method nolint: dupl

func (UserUpdater) SetEmail

func (u UserUpdater) SetEmail(email string) UserUpdater

SetEmail is an autogenerated method nolint: dupl

func (UserUpdater) SetID

func (u UserUpdater) SetID(ID uint) UserUpdater

SetID is an autogenerated method nolint: dupl

func (UserUpdater) SetName

func (u UserUpdater) SetName(name string) UserUpdater

SetName is an autogenerated method nolint: dupl

func (UserUpdater) SetUpdatedAt

func (u UserUpdater) SetUpdatedAt(updatedAt time.Time) UserUpdater

SetUpdatedAt is an autogenerated method nolint: dupl

func (UserUpdater) Update

func (u UserUpdater) Update() error

Update is an autogenerated method nolint: dupl

func (UserUpdater) UpdateNum

func (u UserUpdater) UpdateNum() (int64, error)

UpdateNum is an autogenerated method nolint: dupl

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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