fields

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeletedAt

type DeletedAt sql.NullTime

DeletedAt on delete: the field value will be set to the current datetime. on query: the record will be not returned if it is soft-deleted. if you want to find the record which is soft-deleted, or you want to delete the record forever, you can use db.Unscoped().Find(&users), and db.Unscoped().Delete(&order).

func (DeletedAt) CreateClauses

func (DeletedAt) CreateClauses(f *schema.Field) []clause.Interface

CreateClauses .

func (DeletedAt) DeleteClauses

func (DeletedAt) DeleteClauses(f *schema.Field) []clause.Interface

DeleteClauses .

func (DeletedAt) MarshalJSON

func (n DeletedAt) MarshalJSON() ([]byte, error)

MarshalJSON .

func (DeletedAt) MustValue

func (n DeletedAt) MustValue() time.Time

MustValue returns zero timestamp if the value is null; returns time value if the value is not null. if the value is null returns

func (DeletedAt) QueryClauses

func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface

QueryClauses .

func (*DeletedAt) Scan

func (n *DeletedAt) Scan(value interface{}) error

Scan implements the Scanner interface.

func (*DeletedAt) UnmarshalJSON

func (n *DeletedAt) UnmarshalJSON(b []byte) error

UnmarshalJSON .

func (DeletedAt) UpdateClauses

func (DeletedAt) UpdateClauses(f *schema.Field) []clause.Interface

UpdateClauses .

func (DeletedAt) Value

func (n DeletedAt) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type DeletedAtStamp added in v1.0.8

type DeletedAtStamp sql.NullInt64

DeletedAtStamp is the field type for soft deleting with BIGINT type. 0 or null presents not deleted, an UnixMilli timestamp presents deleted.

func (DeletedAtStamp) CreateClauses added in v1.0.8

func (DeletedAtStamp) CreateClauses(f *schema.Field) []clause.Interface

CreateClauses .

func (DeletedAtStamp) DeleteClauses added in v1.0.8

func (DeletedAtStamp) DeleteClauses(f *schema.Field) []clause.Interface

DeleteClauses .

func (DeletedAtStamp) GormDataType added in v1.0.8

func (DeletedAtStamp) GormDataType() string

GormDataType .

func (DeletedAtStamp) MarshalJSON added in v1.0.8

func (n DeletedAtStamp) MarshalJSON() ([]byte, error)

MarshalJSON .

func (DeletedAtStamp) QueryClauses added in v1.0.8

func (DeletedAtStamp) QueryClauses(f *schema.Field) []clause.Interface

QueryClauses .

func (*DeletedAtStamp) Scan added in v1.0.8

func (n *DeletedAtStamp) Scan(value interface{}) error

Scan .

func (*DeletedAtStamp) UnmarshalJSON added in v1.0.8

func (n *DeletedAtStamp) UnmarshalJSON(b []byte) error

UnmarshalJSON .

func (DeletedAtStamp) UpdateClauses added in v1.0.8

func (DeletedAtStamp) UpdateClauses(f *schema.Field) []clause.Interface

UpdateClauses .

func (DeletedAtStamp) Value added in v1.0.8

func (n DeletedAtStamp) Value() (driver.Value, error)

Value .

type DeletedAtStampCreateClause added in v1.0.8

type DeletedAtStampCreateClause struct {
	Field *schema.Field
	// contains filtered or unexported fields
}

DeletedAtStampCreateClause .

func (DeletedAtStampCreateClause) Build added in v1.0.8

func (DeletedAtStampCreateClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampCreateClause) MergeClause added in v1.0.8

func (DeletedAtStampCreateClause) MergeClause(_ *clause.Clause)

MergeClause .

func (DeletedAtStampCreateClause) ModifyStatement added in v1.0.8

func (c DeletedAtStampCreateClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (DeletedAtStampCreateClause) Name added in v1.0.8

func (DeletedAtStampCreateClause) Name() string

Name .

type DeletedAtStampDeleteClause added in v1.0.8

type DeletedAtStampDeleteClause struct {
	Field *schema.Field
	// contains filtered or unexported fields
}

DeletedAtStampDeleteClause .

func (DeletedAtStampDeleteClause) Build added in v1.0.8

func (DeletedAtStampDeleteClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampDeleteClause) MergeClause added in v1.0.8

func (DeletedAtStampDeleteClause) MergeClause(_ *clause.Clause)

MergeClause .

func (DeletedAtStampDeleteClause) ModifyStatement added in v1.0.8

func (sd DeletedAtStampDeleteClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (DeletedAtStampDeleteClause) Name added in v1.0.8

func (DeletedAtStampDeleteClause) Name() string

Name .

type DeletedAtStampUpdateClause added in v1.0.8

type DeletedAtStampUpdateClause struct {
	Field *schema.Field
	// contains filtered or unexported fields
}

DeletedAtStampUpdateClause .

func (DeletedAtStampUpdateClause) Build added in v1.0.8

func (DeletedAtStampUpdateClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampUpdateClause) MergeClause added in v1.0.8

func (DeletedAtStampUpdateClause) MergeClause(_ *clause.Clause)

MergeClause .

func (DeletedAtStampUpdateClause) ModifyStatement added in v1.0.8

func (qc DeletedAtStampUpdateClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (DeletedAtStampUpdateClause) Name added in v1.0.8

func (DeletedAtStampUpdateClause) Name() string

Name .

type DeletedatstampQueryclause added in v1.0.8

type DeletedatstampQueryclause struct {
	Field *schema.Field
	// contains filtered or unexported fields
}

DeletedatstampQueryclause .

func (DeletedatstampQueryclause) Build added in v1.0.8

func (DeletedatstampQueryclause) Build(_ clause.Builder)

Build .

func (DeletedatstampQueryclause) MergeClause added in v1.0.8

func (DeletedatstampQueryclause) MergeClause(_ *clause.Clause)

MergeClause .

func (DeletedatstampQueryclause) ModifyStatement added in v1.0.8

func (qc DeletedatstampQueryclause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (DeletedatstampQueryclause) Name added in v1.0.8

func (DeletedatstampQueryclause) Name() string

Name .

type SoftDeleteCreateClause

type SoftDeleteCreateClause struct {
	Field *schema.Field
}

SoftDeleteCreateClause .

func (SoftDeleteCreateClause) Build

Build .

func (SoftDeleteCreateClause) MergeClause

func (sd SoftDeleteCreateClause) MergeClause(*clause.Clause)

MergeClause .

func (SoftDeleteCreateClause) ModifyStatement

func (sd SoftDeleteCreateClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (SoftDeleteCreateClause) Name

func (sd SoftDeleteCreateClause) Name() string

Name .

type SoftDeleteDeleteClause

type SoftDeleteDeleteClause struct {
	Field *schema.Field
}

SoftDeleteDeleteClause .

func (SoftDeleteDeleteClause) Build

Build .

func (SoftDeleteDeleteClause) MergeClause

func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause)

MergeClause .

func (SoftDeleteDeleteClause) ModifyStatement

func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (SoftDeleteDeleteClause) Name

func (sd SoftDeleteDeleteClause) Name() string

Name .

type SoftDeleteQueryClause

type SoftDeleteQueryClause struct {
	Field *schema.Field
}

SoftDeleteQueryClause .

func (SoftDeleteQueryClause) Build

Build .

func (SoftDeleteQueryClause) MergeClause

func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause)

MergeClause .

func (SoftDeleteQueryClause) ModifyStatement

func (sd SoftDeleteQueryClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (SoftDeleteQueryClause) Name

func (sd SoftDeleteQueryClause) Name() string

Name .

type SoftDeleteUpdateClause

type SoftDeleteUpdateClause struct {
	Field *schema.Field
}

SoftDeleteUpdateClause .

func (SoftDeleteUpdateClause) Build

Build .

func (SoftDeleteUpdateClause) MergeClause

func (sd SoftDeleteUpdateClause) MergeClause(*clause.Clause)

MergeClause .

func (SoftDeleteUpdateClause) ModifyStatement

func (sd SoftDeleteUpdateClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (SoftDeleteUpdateClause) Name

func (sd SoftDeleteUpdateClause) Name() string

Name .

type UUID

type UUID sql.NullString

UUID auto generate an uuid on creating record.

func (UUID) CreateClauses

func (UUID) CreateClauses(f *schema.Field) []clause.Interface

CreateClauses .

func (UUID) MustValue

func (u UUID) MustValue() string

MustValue returns u.String

func (*UUID) Scan

func (u *UUID) Scan(value interface{}) error

Scan .

func (UUID) Value

func (u UUID) Value() (driver.Value, error)

Value .

type UUIDCreateClause

type UUIDCreateClause struct {
	Field *schema.Field
}

UUIDCreateClause .

func (UUIDCreateClause) Build

func (cc UUIDCreateClause) Build(clause.Builder)

Build .

func (UUIDCreateClause) MergeClause

func (cc UUIDCreateClause) MergeClause(*clause.Clause)

MergeClause .

func (UUIDCreateClause) ModifyStatement

func (cc UUIDCreateClause) ModifyStatement(stmt *gorm.Statement)

ModifyStatement .

func (UUIDCreateClause) Name

func (cc UUIDCreateClause) Name() string

Name .

Jump to

Keyboard shortcuts

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