Documentation ¶
Index ¶
- type Int16
- type Int32
- type Int64
- type IntBuilder
- func (i *IntBuilder[T]) AttrType(dbType dialect.DbDriver) string
- func (i *IntBuilder[T]) Comment(comment string) *IntBuilder[T]
- func (i *IntBuilder[T]) Default(value int16) *IntBuilder[T]
- func (i *IntBuilder[T]) Descriptor() *entity.Descriptor
- func (i *IntBuilder[T]) Init(desc *entity.Descriptor) error
- func (i *IntBuilder[T]) MinLen(size int) *IntBuilder[T]
- func (i *IntBuilder[T]) Name(name string) *IntBuilder[T]
- func (i *IntBuilder[T]) Primary(index int) *IntBuilder[T]
- func (i *IntBuilder[T]) Required() *IntBuilder[T]
- func (i *IntBuilder[T]) Sequence(s entity.Sequence) *IntBuilder[T]
- func (i *IntBuilder[T]) ValueType() string
- type IntStorage
- type RawBytes
- type Scanner
- type String
- type StringBuilder
- func (s *StringBuilder) AttrType(dbType dialect.DbDriver) string
- func (s *StringBuilder) Comment(comment string) *StringBuilder
- func (s *StringBuilder) Default(value string) *StringBuilder
- func (s *StringBuilder) Descriptor() *entity.Descriptor
- func (s *StringBuilder) Init(desc *entity.Descriptor) error
- func (s *StringBuilder) MaxLen(i int64) *StringBuilder
- func (s *StringBuilder) MinLen(i int) *StringBuilder
- func (s *StringBuilder) Name(name string) *StringBuilder
- func (s *StringBuilder) Primary(index int) *StringBuilder
- func (s *StringBuilder) Required() *StringBuilder
- func (s *StringBuilder) ValueType() string
- type StringStorage
- type TimestampStorage
- type Timestamptz
- type TimestamptzBuilder
- func (t *TimestamptzBuilder) AttrType(dbType dialect.DbDriver) string
- func (t *TimestamptzBuilder) Comment(comment string) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Default(value string) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Descriptor() *entity.Descriptor
- func (t *TimestamptzBuilder) Init(desc *entity.Descriptor) error
- func (t *TimestamptzBuilder) MinLen(size int) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Name(name string) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Precision(precision int) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Primary(index int) *TimestamptzBuilder
- func (t *TimestamptzBuilder) Required() *TimestamptzBuilder
- func (t *TimestamptzBuilder) ValueType() string
- type UUID
- type UUIDBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Int16 ¶
type Int16 struct { IntStorage[int16] IntBuilder[int16] }
type Int32 ¶
type Int32 struct { IntStorage[int32] IntBuilder[int32] }
type Int64 ¶
type Int64 struct { IntStorage[int64] IntBuilder[int64] }
type IntBuilder ¶
type IntBuilder[T any] struct { // contains filtered or unexported fields }
func (*IntBuilder[T]) Comment ¶
func (i *IntBuilder[T]) Comment(comment string) *IntBuilder[T]
设置字段的注释。
func (*IntBuilder[T]) Default ¶
func (i *IntBuilder[T]) Default(value int16) *IntBuilder[T]
设置字段的默认值。 如果设置了默认值,则在插入数据时,如果没有设置字段的值,则会使用默认值。
func (*IntBuilder[T]) Descriptor ¶
func (i *IntBuilder[T]) Descriptor() *entity.Descriptor
func (*IntBuilder[T]) Init ¶
func (i *IntBuilder[T]) Init(desc *entity.Descriptor) error
func (*IntBuilder[T]) Name ¶
func (i *IntBuilder[T]) Name(name string) *IntBuilder[T]
func (*IntBuilder[T]) Primary ¶
func (i *IntBuilder[T]) Primary(index int) *IntBuilder[T]
设置字段为主键。 index: 主键的索引,从1开始,对于多个主键,需要设置不同大小的索引。
func (*IntBuilder[T]) Required ¶
func (i *IntBuilder[T]) Required() *IntBuilder[T]
是否非空,默认可以为null,如果调用[Required],则字段为非空字段。
func (*IntBuilder[T]) Sequence ¶
func (i *IntBuilder[T]) Sequence(s entity.Sequence) *IntBuilder[T]
设置字段的序列。 如果序列不存在,则会自动创建序列。 优先级高于[Default]。
func (*IntBuilder[T]) ValueType ¶
func (i *IntBuilder[T]) ValueType() string
type IntStorage ¶
type IntStorage[T any] struct { // contains filtered or unexported fields }
func (*IntStorage[T]) Get ¶
func (i *IntStorage[T]) Get() *T
func (*IntStorage[T]) Scan ¶
func (i *IntStorage[T]) Scan(value interface{}) error
func (*IntStorage[T]) Set ¶
func (i *IntStorage[T]) Set(value T) error
func (IntStorage[T]) String ¶
func (i IntStorage[T]) String() string
func (*IntStorage[T]) Value ¶
func (i *IntStorage[T]) Value() entity.FieldValue
type Scanner ¶
type Scanner interface { // Scan assigns a value from a database driver. // // The src value will be of one of the following types: // // int64 // float64 // bool // []bytetaurus_go/entity/field/field.go // string // time.Time // nil - for NULL values // // An error should be returned if the value cannot be stored // without loss of information. // // Reference types such as []byte are only valid until the next call to Scan // and should not be retained. Their underlying memory is owned by the driver. // If retention is necessary, copy their values before the next call to Scan. Scan(src any) error }
Scanner is an interface used by Scan.
type String ¶
type String struct { StringBuilder StringStorage }
type StringBuilder ¶
type StringBuilder struct {
// contains filtered or unexported fields
}
func (*StringBuilder) Comment ¶
func (s *StringBuilder) Comment(comment string) *StringBuilder
设置字段的注释。
func (*StringBuilder) Default ¶
func (s *StringBuilder) Default(value string) *StringBuilder
设置字段的默认值。 如果设置了默认值,则在插入数据时,如果没有设置字段的值,则会使用默认值。
func (*StringBuilder) Descriptor ¶
func (s *StringBuilder) Descriptor() *entity.Descriptor
func (*StringBuilder) Init ¶
func (s *StringBuilder) Init(desc *entity.Descriptor) error
func (*StringBuilder) Name ¶
func (s *StringBuilder) Name(name string) *StringBuilder
func (*StringBuilder) Primary ¶
func (s *StringBuilder) Primary(index int) *StringBuilder
设置字段为主键。 index: 主键的索引,从1开始,对于多个主键,需要设置不同大小的索引。
func (*StringBuilder) Required ¶
func (s *StringBuilder) Required() *StringBuilder
是否非空,默认可以为null,如果调用[Required],则字段为非空字段。
func (*StringBuilder) ValueType ¶
func (s *StringBuilder) ValueType() string
type StringStorage ¶
type StringStorage struct {
// contains filtered or unexported fields
}
func (*StringStorage) Get ¶
func (i *StringStorage) Get() *string
func (*StringStorage) Scan ¶
func (s *StringStorage) Scan(value any) error
func (*StringStorage) Set ¶
func (i *StringStorage) Set(value string) error
func (StringStorage) String ¶
func (s StringStorage) String() string
func (*StringStorage) Value ¶
func (s *StringStorage) Value() entity.FieldValue
type TimestampStorage ¶
type TimestampStorage struct {
// contains filtered or unexported fields
}
func (*TimestampStorage) Get ¶
func (t *TimestampStorage) Get() *time.Time
func (*TimestampStorage) Scan ¶
func (t *TimestampStorage) Scan(value interface{}) error
func (TimestampStorage) String ¶
func (t TimestampStorage) String() string
func (*TimestampStorage) Value ¶
func (t *TimestampStorage) Value() entity.FieldValue
type Timestamptz ¶
type Timestamptz struct { TimestamptzBuilder TimestampStorage }
type TimestamptzBuilder ¶
type TimestamptzBuilder struct {
// contains filtered or unexported fields
}
func (*TimestamptzBuilder) AttrType ¶
func (t *TimestamptzBuilder) AttrType(dbType dialect.DbDriver) string
func (*TimestamptzBuilder) Comment ¶
func (t *TimestamptzBuilder) Comment(comment string) *TimestamptzBuilder
设置字段的注释。
func (*TimestamptzBuilder) Default ¶
func (t *TimestamptzBuilder) Default(value string) *TimestamptzBuilder
设置字段的默认值。 如果设置了默认值,则在插入数据时,如果没有设置字段的值,则会使用默认值。
func (*TimestamptzBuilder) Descriptor ¶
func (t *TimestamptzBuilder) Descriptor() *entity.Descriptor
func (*TimestamptzBuilder) Init ¶
func (t *TimestamptzBuilder) Init(desc *entity.Descriptor) error
func (*TimestamptzBuilder) MinLen ¶
func (t *TimestamptzBuilder) MinLen(size int) *TimestamptzBuilder
设置字段的最小长度。
func (*TimestamptzBuilder) Name ¶
func (t *TimestamptzBuilder) Name(name string) *TimestamptzBuilder
func (*TimestamptzBuilder) Precision ¶
func (t *TimestamptzBuilder) Precision(precision int) *TimestamptzBuilder
func (*TimestamptzBuilder) Primary ¶
func (t *TimestamptzBuilder) Primary(index int) *TimestamptzBuilder
func (*TimestamptzBuilder) Required ¶
func (t *TimestamptzBuilder) Required() *TimestamptzBuilder
func (*TimestamptzBuilder) ValueType ¶
func (t *TimestamptzBuilder) ValueType() string
type UUID ¶
type UUID struct { UUIDBuilder StringStorage }
type UUIDBuilder ¶
type UUIDBuilder struct {
// contains filtered or unexported fields
}
func (*UUIDBuilder) Descriptor ¶
func (u *UUIDBuilder) Descriptor() *entity.Descriptor
func (*UUIDBuilder) Init ¶
func (u *UUIDBuilder) Init(desc *entity.Descriptor) error
Click to show internal directories.
Click to hide internal directories.