structure

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Directive

type Directive string
const (
	DirectiveSQL                   Directive = "SQL"
	DirectiveSQLPrimary            Directive = "SQL_PRIMARY"
	DirectiveSQLIndex              Directive = "SQL_INDEX"
	DirectiveSQLGorm               Directive = "SQL_GORM"
	DirectiveNoMutation            Directive = "SQL_SKIP_MUTATION"
	DirectiveSQLInputTypeTags      Directive = "SQL_INPUTTYPE_TAGS"
	DirectiveSQLInputTypeDirective Directive = "SQL_INPUTTYPE_DIRECTIVE"
	DirectiveSQLArgumentQuery                = "query"
	DirectiveSQLArgumentMutation             = "mutation"
	DirectiveSQLArgumentOrder                = "order"
)

func (Directive) InternalName added in v0.2.0

func (d Directive) InternalName() string

type Entities

type Entities []Entity

func (Entities) ByName

func (e Entities) ByName(name string) *Entity

type Entity

type Entity struct {
	BuiltIn    bool
	Raw        *ast.FieldDefinition
	RawObject  *ast.Definition
	TypeObject *Object
}

func (Entity) DatabaseFieldName added in v0.0.9

func (e Entity) DatabaseFieldName() string

func (Entity) GormDirectiveValue

func (e Entity) GormDirectiveValue() string

func (Entity) GqlType

func (e Entity) GqlType(suffix string) string

func (Entity) GqlTypeName

func (e Entity) GqlTypeName() string

func (Entity) GqlTypeObj

func (e Entity) GqlTypeObj() *Object

func (Entity) GqlTypePrimaryDataType

func (e Entity) GqlTypePrimaryDataType() string

func (Entity) HasGormDirective

func (e Entity) HasGormDirective() bool

func (*Entity) HasInputTypeDirective added in v0.2.0

func (e *Entity) HasInputTypeDirective() bool

func (*Entity) HasInputTypeTagsDirective added in v0.2.0

func (e *Entity) HasInputTypeTagsDirective() bool

func (Entity) HasMany2ManyDirective

func (e Entity) HasMany2ManyDirective() bool

func (Entity) HasNoMutationDirective added in v0.0.26

func (e Entity) HasNoMutationDirective() bool

func (Entity) Ignore

func (e Entity) Ignore() bool

func (*Entity) InputTypeDirective added in v0.2.0

func (e *Entity) InputTypeDirective() []string

func (*Entity) InputTypeDirectiveGql added in v0.2.0

func (e *Entity) InputTypeDirectiveGql() string

returns the Directive string to extends to template

func (*Entity) InputTypeTagsDirective added in v0.2.0

func (e *Entity) InputTypeTagsDirective() []string

func (*Entity) IsArray

func (e *Entity) IsArray() bool

func (*Entity) IsArrayElementRequired

func (e *Entity) IsArrayElementRequired() bool

func (*Entity) IsEnum added in v0.1.5

func (e *Entity) IsEnum() bool

func (*Entity) IsIndex

func (e *Entity) IsIndex() bool

func (*Entity) IsPrimary

func (e *Entity) IsPrimary() bool

func (*Entity) IsPrimitive added in v0.0.10

func (e *Entity) IsPrimitive() bool

func (*Entity) IsScalar added in v0.1.4

func (e *Entity) IsScalar() bool

func (Entity) IsSoftDeletedAtEntry added in v0.5.4

func (e Entity) IsSoftDeletedAtEntry() bool

func (Entity) IsUnion added in v0.4.6

func (e Entity) IsUnion() bool

func (Entity) Many2ManyDirectiveTable

func (e Entity) Many2ManyDirectiveTable() string

func (Entity) Name

func (e Entity) Name() string

func (*Entity) OrderAble

func (e *Entity) OrderAble() bool

func (*Entity) Required

func (e *Entity) Required() bool

func (Entity) RequiredChar

func (e Entity) RequiredChar() string

func (*Entity) WhereAble

func (e *Entity) WhereAble() bool

type Object

type Object struct {
	Entities Entities
	Raw      *ast.Definition
}

func NewObject

func NewObject(raw *ast.Definition) Object

func (Object) ForeignNameKeyName

func (o Object) ForeignNameKeyName(fieldName string) string

func (Object) GetOrder added in v0.1.0

func (o Object) GetOrder() int64

func (Object) HasSqlDirective

func (o Object) HasSqlDirective() bool

func (Object) InputEntities added in v0.0.10

func (o Object) InputEntities() Entities

func (Object) InputFilterEntities added in v0.0.17

func (o Object) InputFilterEntities() []Entity

func (Object) InputTypeDirective added in v0.2.0

func (o Object) InputTypeDirective() []string

func (Object) InputTypeDirectiveGql added in v0.2.0

func (o Object) InputTypeDirectiveGql() string

returns the Directive string to extends to template

func (Object) Many2ManyRefEntities

func (o Object) Many2ManyRefEntities() map[string]Entity

func (Object) Name

func (o Object) Name() string

func (Object) OrderAbleEntities

func (o Object) OrderAbleEntities() []Entity

func (Object) PatchEntities added in v0.0.10

func (o Object) PatchEntities() Entities

func (Object) PrimaryKeyField

func (o Object) PrimaryKeyField() *Entity

func (Object) PrimaryKeys

func (o Object) PrimaryKeys() []Entity

func (Object) SQLDirective

func (o Object) SQLDirective() *SQLDirective

func (Object) SQLDirectiveValues

func (o Object) SQLDirectiveValues(queryOrMutation QueryMutation, name string) []string

func (Object) WhereAbleEntities

func (o Object) WhereAbleEntities() []Entity

type QueryMutation

type QueryMutation = string
const (
	Query    QueryMutation = "query"
	Mutation QueryMutation = "mutation"
)

type SQLDirective

type SQLDirective struct {
	Query    SQLDirectiveQuery
	Mutation SQLDirectiveMutation
	Order    int64
}

func (*SQLDirective) HasMutation

func (sd *SQLDirective) HasMutation() bool

func (*SQLDirective) HasQueries

func (sd *SQLDirective) HasQueries() bool

type SQLDirectiveHandler

type SQLDirectiveHandler struct {
	DirectiveExt []string
}

type SQLDirectiveMutation

type SQLDirectiveMutation struct {
	SQLDirectiveHandler
	Add    SqlCreateExtension
	Update SqlCreateExtension
	Delete SqlCreateExtension
}

func (*SQLDirectiveMutation) GetDirectiveExt

func (s *SQLDirectiveMutation) GetDirectiveExt(name string) []string

type SQLDirectiveQuery

type SQLDirectiveQuery struct {
	SQLDirectiveHandler
	Get   SqlCreateExtension
	Query SqlCreateExtension
}

func (*SQLDirectiveQuery) GetDirectiveExt

func (s *SQLDirectiveQuery) GetDirectiveExt(name string) []string

type SqlBuilderHelper

type SqlBuilderHelper struct {
	List SqlBuilderList
}

func NewSqlBuilderHelper

func NewSqlBuilderHelper() SqlBuilderHelper

type SqlBuilderList

type SqlBuilderList map[string]*Object

func (SqlBuilderList) Enums added in v0.1.4

func (sbh SqlBuilderList) Enums() map[string]Object

func (SqlBuilderList) Objects

func (sbh SqlBuilderList) Objects() map[string]Object

func (SqlBuilderList) PrimaryEntityOfObject

func (sbh SqlBuilderList) PrimaryEntityOfObject(objectName string) *Entity

type SqlCreateExtension

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

Jump to

Keyboard shortcuts

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