Documentation ¶
Index ¶
- Variables
- func NewMySQLDriver(lc fx.Lifecycle, opt Option, logger *slog.Logger) (*xorm.Engine, error)
- type NullTimestamp
- type Option
- type Timestamp
- type XormSlog
- func (l *XormSlog) Debug(v ...any)
- func (l *XormSlog) Debugf(format string, v ...any)
- func (l *XormSlog) Error(v ...any)
- func (l *XormSlog) Errorf(format string, v ...any)
- func (l *XormSlog) Info(v ...any)
- func (l *XormSlog) Infof(format string, v ...any)
- func (l *XormSlog) IsShowSQL() bool
- func (l *XormSlog) Level() log.LogLevel
- func (l *XormSlog) SetLevel(level log.LogLevel)
- func (l *XormSlog) ShowSQL(show ...bool)
- func (l *XormSlog) Warn(v ...any)
- func (l *XormSlog) Warnf(format string, v ...any)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedType = errors.New("unexpected data type") UnixEpoch = time.UnixMilli(0) )
Functions ¶
Types ¶
type NullTimestamp ¶
NullTimestamp represents a Timestamp that may be null.
func NewNullTimestamp ¶
func NewNullTimestamp(t time.Time) NullTimestamp
func (*NullTimestamp) FromDB ¶
func (ts *NullTimestamp) FromDB(data []byte) error
func (*NullTimestamp) Scan ¶
func (ts *NullTimestamp) Scan(src any) error
func (*NullTimestamp) ToDB ¶
func (ts *NullTimestamp) ToDB() ([]byte, error)
type Option ¶
type Option struct { Host string `json:"host" yaml:"host" toml:"host"` Port int `json:"port,string" yaml:"port" toml:"port"` User string `json:"user" yaml:"user" toml:"user"` Password string `json:"password" yaml:"password" toml:"password"` Database string `json:"database" yaml:"database" toml:"database"` MaxOpenConns int `json:"max_open_conns" yaml:"max_open_conns" toml:"max_open_conns"` MaxIdleConns int `json:"max_idle_conns" yaml:"max_idle_conns" toml:"max_idle_conns"` MaxIdleTime string `json:"max_idle_time" yaml:"max_idle_time" toml:"max_idle_time"` MaxLifetime string `json:"max_lifetime" yaml:"max_lifetime" toml:"max_lifetime"` }
type Timestamp ¶
Timestamp is a type that represents a timestamp in the database
func NewTimestamp ¶
type XormSlog ¶
type XormSlog struct {
// contains filtered or unexported fields
}
func NewXormSlog ¶
Click to show internal directories.
Click to hide internal directories.