Forgot to make the src sit where it should be sitting
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
type DBAccess interface {
|
||||
// I should make a query struct so that I can make generic structs
|
||||
// And then slap them into different types of DBs
|
||||
createq(query string) error
|
||||
selectq(query string) error
|
||||
deleteq(query string) error
|
||||
updateq(query string) error
|
||||
}
|
||||
|
||||
type Database struct {
|
||||
DB *sql.DB
|
||||
Path string
|
||||
}
|
||||
|
||||
func (s *Database) Initialize(path string) error {
|
||||
db, err := sql.Open("sqlite3", path)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s.Path = path
|
||||
s.DB = db
|
||||
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user