owl-blogs/infra/sqlite_db.go

19 lines
270 B
Go
Raw Permalink Normal View History

2023-06-25 19:32:36 +00:00
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
}