Documentation ¶
Index ¶
- type DeletedAt
- func (DeletedAt) CreateClauses(f *schema.Field) []clause.Interface
- func (DeletedAt) DeleteClauses(f *schema.Field) []clause.Interface
- func (n DeletedAt) MarshalJSON() ([]byte, error)
- func (n DeletedAt) MustValue() time.Time
- func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface
- func (n *DeletedAt) Scan(value interface{}) error
- func (n *DeletedAt) UnmarshalJSON(b []byte) error
- func (DeletedAt) UpdateClauses(f *schema.Field) []clause.Interface
- func (n DeletedAt) Value() (driver.Value, error)
- type DeletedAtStamp
- func (DeletedAtStamp) CreateClauses(f *schema.Field) []clause.Interface
- func (DeletedAtStamp) DeleteClauses(f *schema.Field) []clause.Interface
- func (DeletedAtStamp) GormDataType() string
- func (n DeletedAtStamp) MarshalJSON() ([]byte, error)
- func (DeletedAtStamp) QueryClauses(f *schema.Field) []clause.Interface
- func (n *DeletedAtStamp) Scan(value interface{}) error
- func (n *DeletedAtStamp) UnmarshalJSON(b []byte) error
- func (DeletedAtStamp) UpdateClauses(f *schema.Field) []clause.Interface
- func (n DeletedAtStamp) Value() (driver.Value, error)
- type DeletedAtStampCreateClause
- type DeletedAtStampDeleteClause
- type DeletedAtStampUpdateClause
- type DeletedatstampQueryclause
- type SoftDeleteCreateClause
- type SoftDeleteDeleteClause
- type SoftDeleteQueryClause
- type SoftDeleteUpdateClause
- type UUID
- type UUIDCreateClause
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeletedAt ¶
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 ¶
CreateClauses .
func (DeletedAt) DeleteClauses ¶
DeleteClauses .
func (DeletedAt) MustValue ¶
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 ¶
QueryClauses .
func (DeletedAt) UpdateClauses ¶
UpdateClauses .
type DeletedAtStamp ¶ added in v1.0.8
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 .
type DeletedAtStampCreateClause ¶ added in v1.0.8
type DeletedAtStampCreateClause struct { Field *schema.Field // contains filtered or unexported fields }
DeletedAtStampCreateClause .
func (DeletedAtStampCreateClause) MergeClause ¶ added in v1.0.8
MergeClause .
func (DeletedAtStampCreateClause) ModifyStatement ¶ added in v1.0.8
func (c DeletedAtStampCreateClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type DeletedAtStampDeleteClause ¶ added in v1.0.8
type DeletedAtStampDeleteClause struct { Field *schema.Field // contains filtered or unexported fields }
DeletedAtStampDeleteClause .
func (DeletedAtStampDeleteClause) MergeClause ¶ added in v1.0.8
MergeClause .
func (DeletedAtStampDeleteClause) ModifyStatement ¶ added in v1.0.8
func (sd DeletedAtStampDeleteClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type DeletedAtStampUpdateClause ¶ added in v1.0.8
type DeletedAtStampUpdateClause struct { Field *schema.Field // contains filtered or unexported fields }
DeletedAtStampUpdateClause .
func (DeletedAtStampUpdateClause) MergeClause ¶ added in v1.0.8
MergeClause .
func (DeletedAtStampUpdateClause) ModifyStatement ¶ added in v1.0.8
func (qc DeletedAtStampUpdateClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type DeletedatstampQueryclause ¶ added in v1.0.8
type DeletedatstampQueryclause struct { Field *schema.Field // contains filtered or unexported fields }
DeletedatstampQueryclause .
func (DeletedatstampQueryclause) MergeClause ¶ added in v1.0.8
MergeClause .
func (DeletedatstampQueryclause) ModifyStatement ¶ added in v1.0.8
func (qc DeletedatstampQueryclause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type SoftDeleteCreateClause ¶
SoftDeleteCreateClause .
func (SoftDeleteCreateClause) Build ¶
func (sd SoftDeleteCreateClause) Build(clause.Builder)
Build .
func (SoftDeleteCreateClause) MergeClause ¶
func (sd SoftDeleteCreateClause) MergeClause(*clause.Clause)
MergeClause .
func (SoftDeleteCreateClause) ModifyStatement ¶
func (sd SoftDeleteCreateClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type SoftDeleteDeleteClause ¶
SoftDeleteDeleteClause .
func (SoftDeleteDeleteClause) Build ¶
func (sd SoftDeleteDeleteClause) Build(clause.Builder)
Build .
func (SoftDeleteDeleteClause) MergeClause ¶
func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause)
MergeClause .
func (SoftDeleteDeleteClause) ModifyStatement ¶
func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type SoftDeleteQueryClause ¶
SoftDeleteQueryClause .
func (SoftDeleteQueryClause) MergeClause ¶
func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause)
MergeClause .
func (SoftDeleteQueryClause) ModifyStatement ¶
func (sd SoftDeleteQueryClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type SoftDeleteUpdateClause ¶
SoftDeleteUpdateClause .
func (SoftDeleteUpdateClause) Build ¶
func (sd SoftDeleteUpdateClause) Build(clause.Builder)
Build .
func (SoftDeleteUpdateClause) MergeClause ¶
func (sd SoftDeleteUpdateClause) MergeClause(*clause.Clause)
MergeClause .
func (SoftDeleteUpdateClause) ModifyStatement ¶
func (sd SoftDeleteUpdateClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .
type UUID ¶
type UUID sql.NullString
UUID auto generate an uuid on creating record.
func (UUID) CreateClauses ¶
CreateClauses .
type UUIDCreateClause ¶
UUIDCreateClause .
func (UUIDCreateClause) MergeClause ¶
func (cc UUIDCreateClause) MergeClause(*clause.Clause)
MergeClause .
func (UUIDCreateClause) ModifyStatement ¶
func (cc UUIDCreateClause) ModifyStatement(stmt *gorm.Statement)
ModifyStatement .