Documentation
¶
Index ¶
- Constants
- func Dsn(user, password, ip, port, database, charset string, ...) string
- func NewLog(log slog.Logger, opts ...func(*logger.Config)) logger.Interface
- type Base
- type DB
- type Deleted
- type DeletedAt
- func (DeletedAt) DeleteClauses(f *schema.Field) []clause.Interface
- func (n DeletedAt) MarshalJSON() ([]byte, error)
- func (DeletedAt) QueryClauses(f *schema.Field) []clause.Interface
- func (n *DeletedAt) Scan(value interface{}) error
- func (n *DeletedAt) UnmarshalJSON(b []byte) error
- func (d DeletedAt) UpdateClauses(field *schema.Field) []clause.Interface
- func (n DeletedAt) Value() (driver.Value, error)
- type IgnoreSelectLogger
- type Option
- func WithCharset(charset string) Option
- func WithDatabase(db string) Option
- func WithIP(ip string) Option
- func WithLogger(logger glogger.Interface) Option
- func WithMaxIdleConn(maxIdleConn int) Option
- func WithMaxLifetime(connMaxLifetime time.Duration) Option
- func WithMaxOpenConn(maxOpenConn int) Option
- func WithPassword(password string) Option
- func WithPlugins(plugins ...gorm.Plugin) Option
- func WithPort(port string) Option
- func WithReadTimeout(readTimeout time.Duration) Option
- func WithTimeout(timeout time.Duration) Option
- func WithUser(user string) Option
- func WithWriteTimeout(writeTimeout time.Duration) Option
- type SoftDeleteDeleteClause
- type SoftDeleteDeletedClause
- type SoftDeleteQueryClause
- type SoftDeletedAtUpdateClause
- type SoftDeletedQueryClause
- type SoftDeletedUpdateClause
Constants ¶
View Source
const NanosecondPerMillisecond = 1e6
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct { ID uint64 `json:"id,string" gorm:"primary_key:id"` CreatedAt time.Time `json:"created_at" gorm:"column:created_at;not null;comment:创建时间"` UpdatedAt time.Time `json:"updated_at" gorm:"column:updated_at;not null;comment:更新时间"` DeletedAt DeletedAt `json:"-" gorm:"column:deleted_at;index;comment:删除时间"` }
func (*Base) BeforeCreate ¶
type DeletedAt ¶
func (DeletedAt) MarshalJSON ¶
func (*DeletedAt) UnmarshalJSON ¶
func (DeletedAt) UpdateClauses ¶
type IgnoreSelectLogger ¶
type IgnoreSelectLogger struct { }
func (IgnoreSelectLogger) Initialize ¶
func (IgnoreSelectLogger) Initialize(db *gorm.DB) error
func (IgnoreSelectLogger) Name ¶
func (IgnoreSelectLogger) Name() string
type Option ¶
type Option func(*option)
func WithCharset ¶
func WithDatabase ¶
func WithLogger ¶
func WithMaxIdleConn ¶
func WithMaxLifetime ¶
func WithMaxOpenConn ¶
func WithPassword ¶
func WithPlugins ¶
func WithReadTimeout ¶
func WithTimeout ¶
func WithWriteTimeout ¶
type SoftDeleteDeleteClause ¶
func (SoftDeleteDeleteClause) Build ¶
func (sd SoftDeleteDeleteClause) Build(clause.Builder)
func (SoftDeleteDeleteClause) MergeClause ¶
func (sd SoftDeleteDeleteClause) MergeClause(*clause.Clause)
func (SoftDeleteDeleteClause) ModifyStatement ¶
func (sd SoftDeleteDeleteClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeleteDeleteClause) Name ¶
func (sd SoftDeleteDeleteClause) Name() string
type SoftDeleteDeletedClause ¶
func (SoftDeleteDeletedClause) Build ¶
func (s SoftDeleteDeletedClause) Build(clause.Builder)
func (SoftDeleteDeletedClause) MergeClause ¶
func (s SoftDeleteDeletedClause) MergeClause(*clause.Clause)
func (SoftDeleteDeletedClause) ModifyStatement ¶
func (s SoftDeleteDeletedClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeleteDeletedClause) Name ¶
func (s SoftDeleteDeletedClause) Name() string
type SoftDeleteQueryClause ¶
func (SoftDeleteQueryClause) Build ¶
func (sd SoftDeleteQueryClause) Build(clause.Builder)
func (SoftDeleteQueryClause) MergeClause ¶
func (sd SoftDeleteQueryClause) MergeClause(*clause.Clause)
func (SoftDeleteQueryClause) ModifyStatement ¶
func (sd SoftDeleteQueryClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeleteQueryClause) Name ¶
func (sd SoftDeleteQueryClause) Name() string
type SoftDeletedAtUpdateClause ¶
func (SoftDeletedAtUpdateClause) Build ¶
func (s SoftDeletedAtUpdateClause) Build(clause.Builder)
func (SoftDeletedAtUpdateClause) MergeClause ¶
func (s SoftDeletedAtUpdateClause) MergeClause(*clause.Clause)
func (SoftDeletedAtUpdateClause) ModifyStatement ¶
func (s SoftDeletedAtUpdateClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeletedAtUpdateClause) Name ¶
func (s SoftDeletedAtUpdateClause) Name() string
type SoftDeletedQueryClause ¶
func (SoftDeletedQueryClause) Build ¶
func (s SoftDeletedQueryClause) Build(clause.Builder)
func (SoftDeletedQueryClause) MergeClause ¶
func (s SoftDeletedQueryClause) MergeClause(*clause.Clause)
func (SoftDeletedQueryClause) ModifyStatement ¶
func (s SoftDeletedQueryClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeletedQueryClause) Name ¶
func (s SoftDeletedQueryClause) Name() string
type SoftDeletedUpdateClause ¶
func (SoftDeletedUpdateClause) Build ¶
func (s SoftDeletedUpdateClause) Build(clause.Builder)
func (SoftDeletedUpdateClause) MergeClause ¶
func (s SoftDeletedUpdateClause) MergeClause(*clause.Clause)
func (SoftDeletedUpdateClause) ModifyStatement ¶
func (s SoftDeletedUpdateClause) ModifyStatement(stmt *gorm.Statement)
func (SoftDeletedUpdateClause) Name ¶
func (s SoftDeletedUpdateClause) Name() string
Click to show internal directories.
Click to hide internal directories.