fieldx

package
v0.0.0-...-5a6b2d2 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DecimalBuilder

type DecimalBuilder struct {
	// contains filtered or unexported fields
}

func Decimal

func Decimal(name string) *DecimalBuilder

Decimal creates a new decimal field.

func (*DecimalBuilder) Annotations

func (b *DecimalBuilder) Annotations(annotations ...schema.Annotation) *DecimalBuilder

func (*DecimalBuilder) Comment

func (b *DecimalBuilder) Comment(c string) *DecimalBuilder

Comment sets the comment of the field.

func (*DecimalBuilder) Default

func (b *DecimalBuilder) Default(d float64) *DecimalBuilder

Default sets the default value of the field.

func (*DecimalBuilder) Descriptor

func (b *DecimalBuilder) Descriptor() *field.Descriptor

Descriptor implements the ent.Field interface by returning its descriptor.

func (*DecimalBuilder) Immutable

func (b *DecimalBuilder) Immutable() *DecimalBuilder

Immutable indicates that this field cannot be updated.

func (*DecimalBuilder) Max

func (*DecimalBuilder) Min

func (*DecimalBuilder) Nillable

func (b *DecimalBuilder) Nillable() *DecimalBuilder

Nillable indicates that this field is a nillable. Unlike "Optional" only fields, "Nillable" fields are pointers in the generated struct.

func (*DecimalBuilder) Optional

func (b *DecimalBuilder) Optional() *DecimalBuilder

Optional indicates that this field is optional on create. Unlike edges, fields are required by default.

func (*DecimalBuilder) Precision

func (b *DecimalBuilder) Precision(precision, scale int) *DecimalBuilder

Precision sets the precision and scale of the decimal field.

func (*DecimalBuilder) Range

func (b *DecimalBuilder) Range(i, j decimal.Decimal) *DecimalBuilder

func (*DecimalBuilder) SchemaType

func (b *DecimalBuilder) SchemaType(types map[string]string) *DecimalBuilder

func (*DecimalBuilder) StorageKey

func (b *DecimalBuilder) StorageKey(key string) *DecimalBuilder

StorageKey sets the storage key of the field. In SQL dialects is the column name and Gremlin is the property.

func (*DecimalBuilder) StructTag

func (b *DecimalBuilder) StructTag(s string) *DecimalBuilder

StructTag sets the struct tag of the field.

func (*DecimalBuilder) Unique

func (b *DecimalBuilder) Unique() *DecimalBuilder

func (*DecimalBuilder) Validate

func (b *DecimalBuilder) Validate(fn func(d decimal.Decimal) error) *DecimalBuilder

Validate adds a validator for this field. Operation fails if the validation fails.

Jump to

Keyboard shortcuts

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