fields

package
v0.0.0-...-9146478 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2022 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

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

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

CreateClauses .

func (DeletedAtStamp) DeleteClauses

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

DeleteClauses .

func (DeletedAtStamp) GormDataType

func (DeletedAtStamp) GormDataType() string

GormDataType .

func (DeletedAtStamp) MarshalJSON

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

MarshalJSON .

func (DeletedAtStamp) QueryClauses

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

QueryClauses .

func (*DeletedAtStamp) Scan

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

Scan .

func (*DeletedAtStamp) UnmarshalJSON

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

UnmarshalJSON .

func (DeletedAtStamp) UpdateClauses

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

UpdateClauses .

func (DeletedAtStamp) Value

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

Value .

type DeletedAtStampCreateClause

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

DeletedAtStampCreateClause .

func (DeletedAtStampCreateClause) Build

func (DeletedAtStampCreateClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampCreateClause) MergeClause

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

MergeClause .

func (DeletedAtStampCreateClause) ModifyStatement

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

ModifyStatement .

func (DeletedAtStampCreateClause) Name

func (DeletedAtStampCreateClause) Name() string

Name .

type DeletedAtStampDeleteClause

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

DeletedAtStampDeleteClause .

func (DeletedAtStampDeleteClause) Build

func (DeletedAtStampDeleteClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampDeleteClause) MergeClause

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

MergeClause .

func (DeletedAtStampDeleteClause) ModifyStatement

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

ModifyStatement .

func (DeletedAtStampDeleteClause) Name

func (DeletedAtStampDeleteClause) Name() string

Name .

type DeletedAtStampUpdateClause

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

DeletedAtStampUpdateClause .

func (DeletedAtStampUpdateClause) Build

func (DeletedAtStampUpdateClause) Build(_ clause.Builder)

Build .

func (DeletedAtStampUpdateClause) MergeClause

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

MergeClause .

func (DeletedAtStampUpdateClause) ModifyStatement

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

ModifyStatement .

func (DeletedAtStampUpdateClause) Name

func (DeletedAtStampUpdateClause) Name() string

Name .

type DeletedatstampQueryclause

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

DeletedatstampQueryclause .

func (DeletedatstampQueryclause) Build

func (DeletedatstampQueryclause) Build(_ clause.Builder)

Build .

func (DeletedatstampQueryclause) MergeClause

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

MergeClause .

func (DeletedatstampQueryclause) ModifyStatement

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

ModifyStatement .

func (DeletedatstampQueryclause) Name

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