Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sqlr/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ func createInstance(config *Config) (gormDB *gorm.DB, sqlDB *sql.DB, err error)
func getGormConfig(config *Config) *gorm.Config {
newLogger := logger.New(
log.New(os.Stdout, "\r\n", log.LstdFlags),

logger.Config{
SlowThreshold: 200 * time.Millisecond,
LogLevel: config.LogLevel,
Expand All @@ -117,7 +118,7 @@ func getGormConfig(config *Config) *gorm.Config {
return &gorm.Config{
Logger: newLogger,
SkipDefaultTransaction: config.SkipDefaultTransaction,
PrepareStmt: true,
PrepareStmt: config.PreparedStatements,
}
}

Expand Down
1 change: 1 addition & 0 deletions sqlr/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ type Config struct {
MaxConnIdleTime time.Duration
MaxConnLifeTime time.Duration
SkipDefaultTransaction bool
PreparedStatements bool
}

// defaultConfig ...
Expand Down
Loading