model

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type AddCatPayload

type AddCatPayload struct {
	Cat *CatQueryResult `json:"cat"`
}

type AddCompanyPayload

type AddCompanyPayload struct {
	Company *CompanyQueryResult `json:"company"`
}

type AddTodoPayload

type AddTodoPayload struct {
	Todo *TodoQueryResult `json:"todo"`
}

type AddUserPayload

type AddUserPayload struct {
	User *UserQueryResult `json:"user"`
}

type BooleanFilterInput

type BooleanFilterInput struct {
	And     []*bool             `json:"and"`
	Or      []*bool             `json:"or"`
	Not     *BooleanFilterInput `json:"not"`
	Is      *bool               `json:"is"`
	Null    *bool               `json:"null"`
	NotNull *bool               `json:"notNull"`
}

func (*BooleanFilterInput) ExtendsDatabaseQuery

func (d *BooleanFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

type Cat

type Cat struct {
	ID       int       `json:"id" gorm:"primaryKey;autoIncrement;"`
	Name     string    `json:"name"`
	BirthDay time.Time `json:"birthDay"`
	Age      *int      `json:"age" gorm:"-;"`
	UserID   int       `json:"userID"`
	Alive    *bool     `json:"alive" gorm:"default:true;"`
}

type CatFiltersInput

type CatFiltersInput struct {
	ID       *IDFilterInput      `json:"id"`
	Name     *StringFilterInput  `json:"name"`
	BirthDay *TimeFilterInput    `json:"birthDay"`
	UserID   *IntFilterInput     `json:"userID"`
	Alive    *BooleanFilterInput `json:"alive"`
	And      []*CatFiltersInput  `json:"and"`
	Or       []*CatFiltersInput  `json:"or"`
	Not      *CatFiltersInput    `json:"not"`
}

func (*CatFiltersInput) ExtendsDatabaseQuery

func (d *CatFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

func (*CatFiltersInput) PrimaryKeyName

func (d *CatFiltersInput) PrimaryKeyName() string

func (*CatFiltersInput) TableName

func (d *CatFiltersInput) TableName() string

type CatInput

type CatInput struct {
	Name     string    `json:"name"`
	BirthDay time.Time `json:"birthDay"`
	UserID   int       `json:"userID"`
	Alive    *bool     `json:"alive"`
}

func (*CatInput) MergeToType

func (d *CatInput) MergeToType() Cat

type CatOrder

type CatOrder struct {
	Asc  *CatOrderable `json:"asc"`
	Desc *CatOrderable `json:"desc"`
}

type CatOrderable

type CatOrderable string
const (
	CatOrderableID     CatOrderable = "id"
	CatOrderableName   CatOrderable = "name"
	CatOrderableUserID CatOrderable = "userID"
	CatOrderableAlive  CatOrderable = "alive"
)

func (CatOrderable) IsValid

func (e CatOrderable) IsValid() bool

func (CatOrderable) MarshalGQL

func (e CatOrderable) MarshalGQL(w io.Writer)

func (CatOrderable) String

func (e CatOrderable) String() string

func (*CatOrderable) UnmarshalGQL

func (e *CatOrderable) UnmarshalGQL(v interface{}) error

type CatPatch

type CatPatch struct {
	Name     *string    `json:"name"`
	BirthDay *time.Time `json:"birthDay"`
	UserID   *int       `json:"userID"`
	Alive    *bool      `json:"alive"`
}

func (*CatPatch) MergeToType

func (d *CatPatch) MergeToType() map[string]interface{}

type CatQueryResult

type CatQueryResult struct {
	Data       []*Cat `json:"data"`
	Count      int    `json:"count"`
	TotalCount int    `json:"totalCount"`
}

type Company

type Company struct {
	ID              int        `json:"id" gorm:"primaryKey;autoIncrement;"`
	Name            string     `json:"name"`
	Description     *string    `json:"description"`
	MotherCompanyID *int       `json:"motherCompanyID"`
	MotherCompany   *Company   `json:"motherCompany"`
	CreatedAt       *time.Time `json:"createdAt"`
}

type CompanyFiltersInput

type CompanyFiltersInput struct {
	ID              *IDFilterInput         `json:"id"`
	Name            *StringFilterInput     `json:"name"`
	Description     *StringFilterInput     `json:"description"`
	MotherCompanyID *IntFilterInput        `json:"motherCompanyID"`
	MotherCompany   *CompanyFiltersInput   `json:"motherCompany"`
	CreatedAt       *TimeFilterInput       `json:"createdAt"`
	And             []*CompanyFiltersInput `json:"and"`
	Or              []*CompanyFiltersInput `json:"or"`
	Not             *CompanyFiltersInput   `json:"not"`
}

func (*CompanyFiltersInput) ExtendsDatabaseQuery

func (d *CompanyFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

func (*CompanyFiltersInput) PrimaryKeyName

func (d *CompanyFiltersInput) PrimaryKeyName() string

func (*CompanyFiltersInput) TableName

func (d *CompanyFiltersInput) TableName() string

type CompanyInput

type CompanyInput struct {
	Name            string        `json:"name"`
	Description     *string       `json:"description"`
	MotherCompanyID *int          `json:"motherCompanyID"`
	MotherCompany   *CompanyInput `json:"motherCompany"`
}

func (*CompanyInput) MergeToType

func (d *CompanyInput) MergeToType() Company

type CompanyOrder

type CompanyOrder struct {
	Asc  *CompanyOrderable `json:"asc"`
	Desc *CompanyOrderable `json:"desc"`
}

type CompanyOrderable

type CompanyOrderable string
const (
	CompanyOrderableID              CompanyOrderable = "id"
	CompanyOrderableName            CompanyOrderable = "name"
	CompanyOrderableDescription     CompanyOrderable = "description"
	CompanyOrderableMotherCompanyID CompanyOrderable = "motherCompanyID"
)

func (CompanyOrderable) IsValid

func (e CompanyOrderable) IsValid() bool

func (CompanyOrderable) MarshalGQL

func (e CompanyOrderable) MarshalGQL(w io.Writer)

func (CompanyOrderable) String

func (e CompanyOrderable) String() string

func (*CompanyOrderable) UnmarshalGQL

func (e *CompanyOrderable) UnmarshalGQL(v interface{}) error

type CompanyPatch

type CompanyPatch struct {
	Name            *string       `json:"name"`
	Description     *string       `json:"description"`
	MotherCompanyID *int          `json:"motherCompanyID"`
	MotherCompany   *CompanyPatch `json:"motherCompany"`
}

func (*CompanyPatch) MergeToType

func (d *CompanyPatch) MergeToType() map[string]interface{}

type CompanyQueryResult

type CompanyQueryResult struct {
	Data       []*Company `json:"data"`
	Count      int        `json:"count"`
	TotalCount int        `json:"totalCount"`
}

type DeleteCatPayload

type DeleteCatPayload struct {
	Cat   *CatQueryResult `json:"cat"`
	Count int             `json:"count"`
	Msg   *string         `json:"msg"`
}

type DeleteCompanyPayload

type DeleteCompanyPayload struct {
	Company *CompanyQueryResult `json:"company"`
	Count   int                 `json:"count"`
	Msg     *string             `json:"msg"`
}

type DeleteTodoPayload

type DeleteTodoPayload struct {
	Todo  *TodoQueryResult `json:"todo"`
	Count int              `json:"count"`
	Msg   *string          `json:"msg"`
}

type DeleteUserPayload

type DeleteUserPayload struct {
	User  *UserQueryResult `json:"user"`
	Count int              `json:"count"`
	Msg   *string          `json:"msg"`
}

type IDFilterInput

type IDFilterInput struct {
	And     []*int         `json:"and"`
	Or      []*int         `json:"or"`
	Not     *IDFilterInput `json:"not"`
	Eq      *int           `json:"eq"`
	Ne      *int           `json:"ne"`
	Null    *bool          `json:"null"`
	NotNull *bool          `json:"notNull"`
	In      []*int         `json:"in"`
	Notin   []*int         `json:"notin"`
}

func (*IDFilterInput) ExtendsDatabaseQuery

func (d *IDFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

type IntFilterBetween

type IntFilterBetween struct {
	Start int `json:"start"`
	End   int `json:"end"`
}

type IntFilterInput

type IntFilterInput struct {
	And     []*int            `json:"and"`
	Or      []*int            `json:"or"`
	Not     *IntFilterInput   `json:"not"`
	Eq      *int              `json:"eq"`
	Ne      *int              `json:"ne"`
	Gt      *int              `json:"gt"`
	Gte     *int              `json:"gte"`
	Lt      *int              `json:"lt"`
	Lte     *int              `json:"lte"`
	Null    *bool             `json:"null"`
	NotNull *bool             `json:"notNull"`
	In      []*int            `json:"in"`
	NotIn   []*int            `json:"notIn"`
	Between *IntFilterBetween `json:"between"`
}

func (*IntFilterInput) ExtendsDatabaseQuery

func (d *IntFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

type ParentObject

type ParentObject interface {
	TableName() string
	PrimaryKeyName() string
}

type SQLCreateExtension

type SQLCreateExtension struct {
	Value        bool     `json:"value"`
	DirectiveExt []string `json:"directiveExt"`
}

type SQLMutationParams

type SQLMutationParams struct {
	Add          *SQLCreateExtension `json:"add"`
	Update       *SQLCreateExtension `json:"update"`
	Delete       *SQLCreateExtension `json:"delete"`
	DirectiveExt []string            `json:"directiveExt"`
}

type SQLQueryParams

type SQLQueryParams struct {
	Get          *SQLCreateExtension `json:"get"`
	Query        *SQLCreateExtension `json:"query"`
	DirectiveExt []string            `json:"directiveExt"`
}

type StringFilterInput

type StringFilterInput struct {
	And          []*string          `json:"and"`
	Or           []*string          `json:"or"`
	Not          *StringFilterInput `json:"not"`
	Eq           *string            `json:"eq"`
	Eqi          *string            `json:"eqi"`
	Ne           *string            `json:"ne"`
	StartsWith   *string            `json:"startsWith"`
	EndsWith     *string            `json:"endsWith"`
	Contains     *string            `json:"contains"`
	NotContains  *string            `json:"notContains"`
	Containsi    *string            `json:"containsi"`
	NotContainsi *string            `json:"notContainsi"`
	Null         *bool              `json:"null"`
	NotNull      *bool              `json:"notNull"`
	In           []*string          `json:"in"`
	NotIn        []*string          `json:"notIn"`
}

func (*StringFilterInput) ExtendsDatabaseQuery

func (d *StringFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

type TimeFilterBetween

type TimeFilterBetween struct {
	Start time.Time `json:"start"`
	End   time.Time `json:"end"`
}

type TimeFilterInput

type TimeFilterInput struct {
	And     []*time.Time       `json:"and"`
	Or      []*time.Time       `json:"or"`
	Not     *TimeFilterInput   `json:"not"`
	Eq      *time.Time         `json:"eq"`
	Ne      *time.Time         `json:"ne"`
	Gt      *time.Time         `json:"gt"`
	Gte     *time.Time         `json:"gte"`
	Lt      *time.Time         `json:"lt"`
	Lte     *time.Time         `json:"lte"`
	Null    *bool              `json:"null"`
	NotNull *bool              `json:"notNull"`
	In      []*time.Time       `json:"in"`
	NotIn   []*time.Time       `json:"notIn"`
	Between *TimeFilterBetween `json:"between"`
}

func (*TimeFilterInput) ExtendsDatabaseQuery

func (d *TimeFilterInput) ExtendsDatabaseQuery(db *gorm.DB, fieldName string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

type Todo

type Todo struct {
	ID        int        `json:"id" gorm:"primaryKey;autoIncrement;"`
	Name      string     `json:"name"`
	Users     []*User    `json:"users" gorm:"many2many:todo_users;constraint:OnDelete:CASCADE;"`
	Owner     *User      `json:"owner"`
	OwnerID   int        `json:"ownerID"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt"`
}

type TodoFiltersInput

type TodoFiltersInput struct {
	ID        *IDFilterInput      `json:"id"`
	Name      *StringFilterInput  `json:"name"`
	Users     *UserFiltersInput   `json:"users"`
	Owner     *UserFiltersInput   `json:"owner"`
	OwnerID   *IDFilterInput      `json:"ownerID"`
	CreatedAt *TimeFilterInput    `json:"createdAt"`
	UpdatedAt *TimeFilterInput    `json:"updatedAt"`
	DeletedAt *TimeFilterInput    `json:"deletedAt"`
	And       []*TodoFiltersInput `json:"and"`
	Or        []*TodoFiltersInput `json:"or"`
	Not       *TodoFiltersInput   `json:"not"`
}

func (*TodoFiltersInput) ExtendsDatabaseQuery

func (d *TodoFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

func (*TodoFiltersInput) PrimaryKeyName

func (d *TodoFiltersInput) PrimaryKeyName() string

func (*TodoFiltersInput) TableName

func (d *TodoFiltersInput) TableName() string

type TodoInput

type TodoInput struct {
	Name string `json:"name"`
}

func (*TodoInput) MergeToType

func (d *TodoInput) MergeToType() Todo

type TodoOrder

type TodoOrder struct {
	Asc  *TodoOrderable `json:"asc"`
	Desc *TodoOrderable `json:"desc"`
}

type TodoOrderable

type TodoOrderable string
const (
	TodoOrderableID      TodoOrderable = "id"
	TodoOrderableName    TodoOrderable = "name"
	TodoOrderableOwnerID TodoOrderable = "ownerID"
)

func (TodoOrderable) IsValid

func (e TodoOrderable) IsValid() bool

func (TodoOrderable) MarshalGQL

func (e TodoOrderable) MarshalGQL(w io.Writer)

func (TodoOrderable) String

func (e TodoOrderable) String() string

func (*TodoOrderable) UnmarshalGQL

func (e *TodoOrderable) UnmarshalGQL(v interface{}) error

type TodoPatch

type TodoPatch struct {
	Name *string `json:"name"`
}

func (*TodoPatch) MergeToType

func (d *TodoPatch) MergeToType() map[string]interface{}

type TodoQueryResult

type TodoQueryResult struct {
	Data       []*Todo `json:"data"`
	Count      int     `json:"count"`
	TotalCount int     `json:"totalCount"`
}

type UpdateCatInput

type UpdateCatInput struct {
	Filter *CatFiltersInput `json:"filter"`
	Set    *CatPatch        `json:"set"`
}

type UpdateCatPayload

type UpdateCatPayload struct {
	Cat   *CatQueryResult `json:"cat"`
	Count int             `json:"count"`
}

type UpdateCompanyInput

type UpdateCompanyInput struct {
	Filter *CompanyFiltersInput `json:"filter"`
	Set    *CompanyPatch        `json:"set"`
}

type UpdateCompanyPayload

type UpdateCompanyPayload struct {
	Company *CompanyQueryResult `json:"company"`
	Count   int                 `json:"count"`
}

type UpdateTodoInput

type UpdateTodoInput struct {
	Filter *TodoFiltersInput `json:"filter"`
	Set    *TodoPatch        `json:"set"`
}

type UpdateTodoPayload

type UpdateTodoPayload struct {
	Todo  *TodoQueryResult `json:"todo"`
	Count int              `json:"count"`
}

type UpdateUserInput

type UpdateUserInput struct {
	Filter *UserFiltersInput `json:"filter"`
	Set    *UserPatch        `json:"set"`
}

type UpdateUserPayload

type UpdateUserPayload struct {
	User  *UserQueryResult `json:"user"`
	Count int              `json:"count"`
}

type User

type User struct {
	ID        int        `json:"id" gorm:"primaryKey;autoIncrement;"`
	Name      string     `json:"name"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
	DeletedAt *time.Time `json:"deletedAt"`
	Cat       *Cat       `json:"cat" gorm:"constraint:OnUpdate:CASCADE,OnDelete:SET NULL;;"`
	CompanyID *int       `json:"companyID"`
	Company   *Company   `json:"company"`
}

type UserFiltersInput

type UserFiltersInput struct {
	ID        *IDFilterInput       `json:"id"`
	Name      *StringFilterInput   `json:"name"`
	CreatedAt *TimeFilterInput     `json:"createdAt"`
	UpdatedAt *TimeFilterInput     `json:"updatedAt"`
	DeletedAt *TimeFilterInput     `json:"deletedAt"`
	Cat       *CatFiltersInput     `json:"cat"`
	CompanyID *IntFilterInput      `json:"companyID"`
	Company   *CompanyFiltersInput `json:"company"`
	And       []*UserFiltersInput  `json:"and"`
	Or        []*UserFiltersInput  `json:"or"`
	Not       *UserFiltersInput    `json:"not"`
}

func (*UserFiltersInput) ExtendsDatabaseQuery

func (d *UserFiltersInput) ExtendsDatabaseQuery(db *gorm.DB, alias string, deep bool, blackList map[string]struct{}) []runtimehelper.ConditionElement

func (*UserFiltersInput) PrimaryKeyName

func (d *UserFiltersInput) PrimaryKeyName() string

func (*UserFiltersInput) TableName

func (d *UserFiltersInput) TableName() string

type UserInput

type UserInput struct {
	Name      string        `json:"name"`
	Cat       *CatInput     `json:"cat"`
	CompanyID *int          `json:"companyID"`
	Company   *CompanyInput `json:"company"`
}

func (*UserInput) MergeToType

func (d *UserInput) MergeToType() User

type UserOrder

type UserOrder struct {
	Asc  *UserOrderable `json:"asc"`
	Desc *UserOrderable `json:"desc"`
}

type UserOrderable

type UserOrderable string
const (
	UserOrderableID        UserOrderable = "id"
	UserOrderableName      UserOrderable = "name"
	UserOrderableCompanyID UserOrderable = "companyID"
)

func (UserOrderable) IsValid

func (e UserOrderable) IsValid() bool

func (UserOrderable) MarshalGQL

func (e UserOrderable) MarshalGQL(w io.Writer)

func (UserOrderable) String

func (e UserOrderable) String() string

func (*UserOrderable) UnmarshalGQL

func (e *UserOrderable) UnmarshalGQL(v interface{}) error

type UserPatch

type UserPatch struct {
	Name      *string       `json:"name"`
	Cat       *CatPatch     `json:"cat"`
	CompanyID *int          `json:"companyID"`
	Company   *CompanyPatch `json:"company"`
}

func (*UserPatch) MergeToType

func (d *UserPatch) MergeToType() map[string]interface{}

type UserQueryResult

type UserQueryResult struct {
	Data       []*User `json:"data"`
	Count      int     `json:"count"`
	TotalCount int     `json:"totalCount"`
}

type UserRef2TodosInput

type UserRef2TodosInput struct {
	Filter *TodoFiltersInput `json:"filter"`
	Set    []int             `json:"set"`
}

Jump to

Keyboard shortcuts

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