Add post model and store

This commit is contained in:
Miguel de la Cruz 2021-09-13 23:46:35 +02:00
parent 701dfbe179
commit a0058eae63
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,15 @@
package store
import (
"database/sql"
)
var postColums = []string{"id", "user_id", "game_id", "createdat", "body"}
type PostStore struct {
Conn *sql.DB
}
func NewPostStore(s *Store) *PostStore {
return &PostStore{Conn: s.Conn}
}

View file

@ -14,6 +14,7 @@ type Store struct {
userStore *UserStore
gameStore *GameStore
postStore *PostStore
}
func addPathOptions(path string) string {
@ -40,6 +41,7 @@ func NewStore(path string) (*Store, error) {
// init stores
s.userStore = NewUserStore(s)
s.gameStore = NewGameStore(s)
s.postStore = NewPostStore(s)
return s, nil
}