19 lines
270 B
Go
19 lines
270 B
Go
|
package infra
|
||
|
|
||
|
import (
|
||
|
"github.com/jmoiron/sqlx"
|
||
|
)
|
||
|
|
||
|
type SqliteDatabase struct {
|
||
|
db *sqlx.DB
|
||
|
}
|
||
|
|
||
|
func NewSqliteDB(path string) Database {
|
||
|
db := sqlx.MustOpen("sqlite3", path)
|
||
|
return &SqliteDatabase{db: db}
|
||
|
}
|
||
|
|
||
|
func (d *SqliteDatabase) Get() *sqlx.DB {
|
||
|
return d.db
|
||
|
}
|