add db package
db package allows for writing games to postgres db
This commit is contained in:
parent
7426ddaf74
commit
38368ba151
2 changed files with 106 additions and 0 deletions
|
|
@ -16,6 +16,8 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
// adding custom stuff here
|
||||
|
||||
"github.com/BattlesnakeOfficial/rules"
|
||||
"github.com/BattlesnakeOfficial/rules/board"
|
||||
"github.com/BattlesnakeOfficial/rules/client"
|
||||
|
|
@ -25,8 +27,15 @@ import (
|
|||
"github.com/pkg/browser"
|
||||
"github.com/spf13/cobra"
|
||||
log "github.com/spf13/jwalterweatherman"
|
||||
|
||||
// adding custom stuff below here
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
var db *pgxpool.Pool // global database connection pool
|
||||
|
||||
// store frames in memory for now
|
||||
// will write to db at end of game
|
||||
var frames []board.GameEvent
|
||||
|
||||
// Used to store state for each SnakeState while running a local game
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue