Skip to content

Commit

Permalink
Add WithDialect Option
Browse files Browse the repository at this point in the history
  • Loading branch information
clannadxr committed Dec 12, 2023
1 parent 50d6e90 commit dd1ab7c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion option.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package egorm

import (
"github.com/ego-component/egorm/manager"
"gorm.io/gorm/schema"

"github.com/ego-component/egorm/manager"
)

// Option 可选项
Expand All @@ -15,6 +16,13 @@ func WithDSN(dsn string) Option {
}
}

// WithDialect 设置 dialect
func WithDialect(dialect string) Option {
return func(c *Container) {
c.config.Dialect = dialect
}
}

// WithDSNParser 设置自定义dsnParser
func WithDSNParser(parser manager.DSNParser) Option {
return func(c *Container) {
Expand Down

0 comments on commit dd1ab7c

Please sign in to comment.