Discover Packages
github.com/phyrwork/bogglr
pkg
database
package
Version:
v0.0.0-...-2b2b3c0
Opens a new window with list of versions in this module.
Published: Apr 10, 2022
License: GPL-3.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
View Source
var DefaultDSN = "host=localhost user=bogglr password=bogglr dbname=bogglr sslmode=disable"
type Game struct {
ID int `gorm:"primaryKey;not null"`
Board Board `gorm:"not null;type:varchar(16)[16];check:cardinality(board) <= 16"`
}
Path is a PostgreSQL open path.
type Player struct {
ID int `gorm:"primaryKey;not null"`
Name string `gorm:"not null"`
Words []Word `gorm:"many2many:word_players"`
}
Point is a PostgreSQL point (closed notation).
type Word struct {
ID int `gorm:"primaryKey;not null"`
GameID int `gorm:"not null;uniqueKey:idx_word"`
Game *Game
Path Path `gorm:"not null;uniqueKey:idx_word"`
Players []Player `gorm:"many2many:word_players"`
}
type WordPlayer struct {
WordID int `gorm:"primaryKey;not null"`
Word *Word
PlayerID int `gorm:"primaryKey;not null"`
Player *Player
}
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.