initial commit for bookish-server and local environment

This commit is contained in:
David Thompson
2020-05-26 00:30:20 -04:00
parent d634e9d00f
commit 2bc790c87b
48 changed files with 15860 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
package mysql
import (
"github.com/jmoiron/sqlx"
)
// store holds a connection to the application database.
type store struct {
*sqlx.DB
}
// NewStore creates a new connection to the database and returns a store containing the connection.
func NewStore(dsn string) (s *store, err error) {
db, err := sqlx.Open("mysql", dsn)
if err != nil {
return s, err
}
return &store{db}, nil
}