Documentation ¶
Overview ¶
Package postgresql provides a gorm driver for postgresql.
Index ¶
- func Close(db *gorm.DB) error
- func Init(dsn string, opts ...Option) (*gorm.DB, error)
- type Option
- func WithConnMaxLifetime(t time.Duration) Option
- func WithEnableForeignKey() Option
- func WithEnableTrace() Option
- func WithGormPlugin(plugins ...gorm.Plugin) Option
- func WithLogRequestIDKey(key string) Option
- func WithLogging(l *zap.Logger, level ...logger.LogLevel) Option
- func WithMaxIdleConns(size int) Option
- func WithMaxOpenConns(size int) Option
- func WithSlowThreshold(d time.Duration) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*options)
Option set the mysql options.
func WithConnMaxLifetime ¶
WithConnMaxLifetime set conn max lifetime
func WithEnableForeignKey ¶
func WithEnableForeignKey() Option
WithEnableForeignKey use foreign keys
func WithGormPlugin ¶
WithGormPlugin setting gorm plugin
func WithLogRequestIDKey ¶
WithLogRequestIDKey log request id
func WithLogging ¶
WithLogging set log sql, If l=nil, the gorm log library will be used
func WithSlowThreshold ¶
WithSlowThreshold Set sql values greater than the threshold
Click to show internal directories.
Click to hide internal directories.