gorm4

package
v0.0.0-...-c37bf90 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Code generated by go-queryset. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var UserDBSchema = struct {
	ID          UserDBSchemaField
	CreatedAt   UserDBSchemaField
	UpdatedAt   UserDBSchemaField
	DeletedAt   UserDBSchemaField
	Rating      UserDBSchemaField
	RatingMarks UserDBSchemaField
}{

	ID:          UserDBSchemaField("id"),
	CreatedAt:   UserDBSchemaField("created_at"),
	UpdatedAt:   UserDBSchemaField("updated_at"),
	DeletedAt:   UserDBSchemaField("deleted_at"),
	Rating:      UserDBSchemaField("rating"),
	RatingMarks: UserDBSchemaField("rating_marks"),
}

UserDBSchema stores db field names of User

Functions

This section is empty.

Types

type User

type User struct {
	gorm.Model
	Rating      int
	RatingMarks int
}

User struct represents user model. gen:qs

func GetUsersRegisteredToday

func GetUsersRegisteredToday(limit int) ([]User, error)

GetUsersRegisteredToday returns limit users registered today

func GetUsersRegisteredTodayWithMaxRating

func GetUsersRegisteredTodayWithMaxRating(limit int) ([]User, error)

GetUsersRegisteredTodayWithMaxRating returns limit users registered today and with max rating

func GetUsersWithMaxRating

func GetUsersWithMaxRating(limit int) ([]User, error)

GetUsersWithMaxRating returns limit users with max rating

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 nolint: dupl

type UserDBSchemaField

type UserDBSchemaField string

UserDBSchemaField describes database schema field. It requires for method 'Update'

func (UserDBSchemaField) String

func (f UserDBSchemaField) String() string

String method returns string representation of field. nolint: dupl

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() (int64, 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) DeleteNum

func (qs UserQuerySet) DeleteNum() (int64, error)

DeleteNum is an autogenerated method nolint: dupl

func (UserQuerySet) DeleteNumUnscoped

func (qs UserQuerySet) DeleteNumUnscoped() (int64, error)

DeleteNumUnscoped is an autogenerated method nolint: dupl

func (UserQuerySet) GetDB

func (qs UserQuerySet) GetDB() *gorm.DB

GetDB 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) 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) 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) Offset

func (qs UserQuerySet) Offset(offset int) UserQuerySet

Offset 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) OrderAscByID

func (qs UserQuerySet) OrderAscByID() UserQuerySet

OrderAscByID is an autogenerated method nolint: dupl

func (UserQuerySet) OrderAscByRating

func (qs UserQuerySet) OrderAscByRating() UserQuerySet

OrderAscByRating is an autogenerated method nolint: dupl

func (UserQuerySet) OrderAscByRatingMarks

func (qs UserQuerySet) OrderAscByRatingMarks() UserQuerySet

OrderAscByRatingMarks 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) OrderDescByID

func (qs UserQuerySet) OrderDescByID() UserQuerySet

OrderDescByID is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByRating

func (qs UserQuerySet) OrderDescByRating() UserQuerySet

OrderDescByRating is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByRatingMarks

func (qs UserQuerySet) OrderDescByRatingMarks() UserQuerySet

OrderDescByRatingMarks is an autogenerated method nolint: dupl

func (UserQuerySet) OrderDescByUpdatedAt

func (qs UserQuerySet) OrderDescByUpdatedAt() UserQuerySet

OrderDescByUpdatedAt is an autogenerated method nolint: dupl

func (UserQuerySet) PreloadDeletedAt

func (qs UserQuerySet) PreloadDeletedAt() UserQuerySet

PreloadDeletedAt is an autogenerated method nolint: dupl

func (UserQuerySet) RatingEq

func (qs UserQuerySet) RatingEq(rating int) UserQuerySet

RatingEq is an autogenerated method nolint: dupl

func (UserQuerySet) RatingGt

func (qs UserQuerySet) RatingGt(rating int) UserQuerySet

RatingGt is an autogenerated method nolint: dupl

func (UserQuerySet) RatingGte

func (qs UserQuerySet) RatingGte(rating int) UserQuerySet

RatingGte is an autogenerated method nolint: dupl

func (UserQuerySet) RatingIn

func (qs UserQuerySet) RatingIn(rating ...int) UserQuerySet

RatingIn is an autogenerated method nolint: dupl

func (UserQuerySet) RatingLt

func (qs UserQuerySet) RatingLt(rating int) UserQuerySet

RatingLt is an autogenerated method nolint: dupl

func (UserQuerySet) RatingLte

func (qs UserQuerySet) RatingLte(rating int) UserQuerySet

RatingLte is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksEq

func (qs UserQuerySet) RatingMarksEq(ratingMarks int) UserQuerySet

RatingMarksEq is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksGt

func (qs UserQuerySet) RatingMarksGt(ratingMarks int) UserQuerySet

RatingMarksGt is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksGte

func (qs UserQuerySet) RatingMarksGte(ratingMarks int) UserQuerySet

RatingMarksGte is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksIn

func (qs UserQuerySet) RatingMarksIn(ratingMarks ...int) UserQuerySet

RatingMarksIn is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksLt

func (qs UserQuerySet) RatingMarksLt(ratingMarks int) UserQuerySet

RatingMarksLt is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksLte

func (qs UserQuerySet) RatingMarksLte(ratingMarks int) UserQuerySet

RatingMarksLte is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksNe

func (qs UserQuerySet) RatingMarksNe(ratingMarks int) UserQuerySet

RatingMarksNe is an autogenerated method nolint: dupl

func (UserQuerySet) RatingMarksNotIn

func (qs UserQuerySet) RatingMarksNotIn(ratingMarks ...int) UserQuerySet

RatingMarksNotIn is an autogenerated method nolint: dupl

func (UserQuerySet) RatingNe

func (qs UserQuerySet) RatingNe(rating int) UserQuerySet

RatingNe is an autogenerated method nolint: dupl

func (UserQuerySet) RatingNotIn

func (qs UserQuerySet) RatingNotIn(rating ...int) UserQuerySet

RatingNotIn is an autogenerated method nolint: dupl

func (UserQuerySet) RegisteredToday

func (qs UserQuerySet) RegisteredToday() UserQuerySet

RegisteredToday returns only users registered today

func (UserQuerySet) Select

func (qs UserQuerySet) Select(fields ...UserDBSchemaField) UserQuerySet

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

func (UserQuerySet) WithMaxRating

func (qs UserQuerySet) WithMaxRating(minMarks int) UserQuerySet

WithMaxRating is our defined on UserQuerySet method, that selects users with max rating. UserQuerySet is an autogenerated struct with a lot of typesafe methods. We can define any methods on it because it's in the same package

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 nolint: dupl

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 gorm.DeletedAt) UserUpdater

SetDeletedAt 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) SetRating

func (u UserUpdater) SetRating(rating int) UserUpdater

SetRating is an autogenerated method nolint: dupl

func (UserUpdater) SetRatingMarks

func (u UserUpdater) SetRatingMarks(ratingMarks int) UserUpdater

SetRatingMarks 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

Jump to

Keyboard shortcuts

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