You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
371 B
Go
20 lines
371 B
Go
2 years ago
|
package database
|
||
|
|
||
|
import "database/sql"
|
||
|
|
||
|
// Uncomment if actually using SQLite, the first build will be fairly slow
|
||
|
// import _ "github.com/mattn/go-sqlite3"
|
||
|
|
||
|
type sqliteDatabase struct {
|
||
|
Db *sql.DB
|
||
|
}
|
||
|
|
||
|
func NewSQLite(filename string) (Database, error) {
|
||
|
db, err := sql.Open("sqlite3", filename)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
|
||
|
return &sqliteDatabase{db}, nil
|
||
|
}
|