types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package types contains all types definition for gqlgin/gorm

Index

Constants

View Source
const ColumnSeparator = "_"
View Source
const GroupSeparator = "/"

Variables

View Source
var DatabaseEscapeCharacters = map[DatabaseType]struct{ Left, Right string }{
	MySQL:     {"`", "`"},
	Postgres:  {"\"", "\""},
	Oracle:    {"\"", "\""},
	SQLite:    {"\"", "\""},
	DB2:       {"\"", "\""},
	SQLServer: {"[", "]"},
}

Functions

func FloatToString

func FloatToString(id Float) string

func Format

func Format(time time.Time) string

func ParseTimeInLocation

func ParseTimeInLocation(timeStr string) (time.Time, error)

func String

func String(id ID) string

String converts ID instance to string expression

Types

type ColumnName

type ColumnName string
const (
	ColumnApproveReason       ColumnName = "approve_reason"
	ColumnBpmNo               ColumnName = "bpm_no"
	ColumnBpmStatus           ColumnName = "bpm_status"
	ColumnCreatorId           ColumnName = "creator_id"
	ColumnCreatorDisplayName  ColumnName = "creator_display_name"
	ColumnCreateTime          ColumnName = "create_time"
	ColumnDeleteTime          ColumnName = "delete_time"
	ColumnDeleteFlag          ColumnName = "delete_flag"
	ColumnIdentifier          ColumnName = "id"
	ColumnMatchTypes          ColumnName = "match_types"
	ColumnModifierId          ColumnName = "modifier_id"
	ColumnModifierDisplayName ColumnName = "modifier_display_name"
	ColumnModifiedBy          ColumnName = "modified_by"
	ColumnModify              ColumnName = "modify"
	ColumnModifyTime          ColumnName = "modify_time"
	ColumnPublishedFlag       ColumnName = "published_flag"
	ColumnStatus              ColumnName = "status"
	ColumnUpdateTime          ColumnName = "update_time"
	ColumnValidFlag           ColumnName = "valid_flag"
	ColumnVersion             ColumnName = "version"
	ColumnWeight              ColumnName = "weight"
	ColumnLastReleasedTime    ColumnName = "latest_released_time"
)

func GroupToColumnName

func GroupToColumnName(group string) ColumnName

func (ColumnName) Append

func (c ColumnName) Append(argv ...string) ColumnName

func (ColumnName) Dup

func (c ColumnName) Dup() *string

func (ColumnName) Equal

func (c ColumnName) Equal(other *ColumnName) bool

func (ColumnName) Group

func (c ColumnName) Group(argv ...string) string

func (ColumnName) MarshalGQL

func (c ColumnName) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*ColumnName) Scan

func (c *ColumnName) Scan(value interface{}) error

Scan 实现了 sql.Scanner 接口

func (ColumnName) String

func (c ColumnName) String() string

func (*ColumnName) UnmarshalGQL

func (c *ColumnName) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (ColumnName) Value

func (c ColumnName) Value() (driver.Value, error)

type DatabaseType

type DatabaseType string
const (
	MySQL     DatabaseType = "mysql"     // gorm:gorm@tcp(127.0.0.1:3306)/gorm?charset=utf8&parseTime=True&loc=Local
	Postgres  DatabaseType = "postgres"  // host=localhost user=gorm password=gorm dbname=gorm port=9920 sslmode=disable TimeZone=Asia/Shanghai
	Oracle    DatabaseType = "oracle"    // oracle://user:password@127.0.0.1:1521/service
	SQLite    DatabaseType = "sqlite"    // test.db
	SQLServer DatabaseType = "sqlserver" // sqlserver://gorm:LoremIpsum86@localhost:9930?database=gorm
	DB2       DatabaseType = "db2"
)

func (DatabaseType) Equal

func (c DatabaseType) Equal(other *DatabaseType) bool

func (DatabaseType) MarshalGQL

func (c DatabaseType) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (DatabaseType) Quote

func (c DatabaseType) Quote(i string) (o string)

func (*DatabaseType) Scan

func (c *DatabaseType) Scan(value interface{}) error

Scan 实现了 sql.Scanner 接口

func (DatabaseType) String

func (c DatabaseType) String() string

func (*DatabaseType) UnmarshalGQL

func (c *DatabaseType) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (DatabaseType) Value

func (c DatabaseType) Value() (driver.Value, error)

type EndpointSourceType

type EndpointSourceType string
const (
	ServiceEndpoint  EndpointSourceType = "Service"
	InternalEndpoint EndpointSourceType = "Internal"
)

func (EndpointSourceType) Equal

func (c EndpointSourceType) Equal(other *EndpointSourceType) bool

func (EndpointSourceType) MarshalGQL

func (y EndpointSourceType) MarshalGQL(w io.Writer)

func (*EndpointSourceType) Scan

func (y *EndpointSourceType) Scan(value interface{}) error

Scan 实现了 sql.Scanner 接口

func (EndpointSourceType) String

func (y EndpointSourceType) String() string

func (*EndpointSourceType) UnmarshalGQL

func (y *EndpointSourceType) UnmarshalGQL(v interface{}) error

func (EndpointSourceType) Value

func (y EndpointSourceType) Value() (driver.Value, error)

type Float

type Float float64

func (Float) MarshalGQL

func (y Float) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*Float) UnmarshalGQL

func (y *Float) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*Float) Value

func (y *Float) Value() float64

type ID

type ID int64

ID type alias

func (ID) MarshalGQL

func (y ID) MarshalGQL(w io.Writer)

MarshalGQL implements the graphql.Marshaler interface

func (*ID) Ptr

func (y *ID) Ptr() *int64

Ptr returns pointer to the actual value

func (*ID) UnmarshalGQL

func (y *ID) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements the graphql.Unmarshaler interface

func (*ID) Value

func (y *ID) Value() int64

Value returns int64 representive

type Id

type Id = ID

Id used for backward compatibility

type IntCount

type IntCount int64

func (IntCount) MarshalGQL

func (y IntCount) MarshalGQL(w io.Writer)

func (*IntCount) UnmarshalGQL

func (y *IntCount) UnmarshalGQL(v interface{}) error

type MatchType

type MatchType string
const (
	MatchAny    MatchType = "any"
	MatchEqual  MatchType = "equal"
	MatchGroup  MatchType = "group"
	MatchPrefix MatchType = "prefix"
)

func (MatchType) Equal

func (c MatchType) Equal(other *MatchType) bool

func (MatchType) MarshalGQL

func (y MatchType) MarshalGQL(w io.Writer)

func (*MatchType) Scan

func (c *MatchType) Scan(value interface{}) error

Scan 实现了 sql.Scanner 接口

func (MatchType) String

func (y MatchType) String() string

func (*MatchType) UnmarshalGQL

func (y *MatchType) UnmarshalGQL(v interface{}) error

type ParameterType

type ParameterType string
const (
	TypeBool      ParameterType = "bool"
	TypeDouble    ParameterType = "double"
	TypeIdentity  ParameterType = "id"
	TypeInt       ParameterType = "int"
	TypeGroup     ParameterType = "group"
	TypeJson      ParameterType = "json"
	TypeState     ParameterType = "state"
	TypeString    ParameterType = "string"
	TypeText      ParameterType = "text"
	TypeTimestamp ParameterType = "timestamp"
	TypeArray     ParameterType = "array"
)

func (ParameterType) Equal

func (c ParameterType) Equal(other *ParameterType) bool

func (ParameterType) MarshalGQL

func (y ParameterType) MarshalGQL(w io.Writer)

func (*ParameterType) Scan

func (y *ParameterType) Scan(value interface{}) error

Scan 实现了 sql.Scanner 接口

func (ParameterType) String

func (y ParameterType) String() string

func (ParameterType) To

func (y ParameterType) To(val interface{}) (v string, err error)

func (*ParameterType) UnmarshalGQL

func (y *ParameterType) UnmarshalGQL(v interface{}) error

func (ParameterType) Value

func (y ParameterType) Value() (driver.Value, error)

type Timestamp

type Timestamp = ID

Timestamp used for timestamp(int64)

Jump to

Keyboard shortcuts

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