Skip to content
Merged
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
10 changes: 10 additions & 0 deletions sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ type Dialector struct {
Conn gorm.ConnPool
}

type Config struct {
DriverName string
DSN string
Conn gorm.ConnPool
}

func Open(dsn string) gorm.Dialector {
return &Dialector{DSN: dsn}
}

func New(config Config) gorm.Dialector {
return &Dialector{DSN: config.DSN, DriverName: config.DriverName, Conn: config.Conn}
}

func (dialector Dialector) Name() string {
return "sqlite"
}
Expand Down