Documentation
¶
Index ¶
Constants ¶
const ( ItemListQuery = `SELECT id, name, description, owner_id, location_item_id, location_player_id, location_room_id, created, updated FROM items` ItemGetQuery = `` /* 137-byte string literal not displayed */ ItemCreateQuery = `INSERT INTO items (name, description, owner_id, location_item_id, location_player_id, location_room_id) ` + `VALUES ($1, $2, $3, $4, $5, $6) ` + `RETURNING id, name, description, owner_id, location_item_id, location_player_id, location_room_id, created, updated` ItemUpdateQuery = `UPDATE items SET name = $2, description = $3, owner_id = $4, location_item_id = $5, location_player_id = $6, location_room_id = $7 ` + `WHERE id = $1 ` + `RETURNING id, name, description, owner_id, location_item_id, location_player_id, location_room_id, created, updated` ItemRemoveQuery = `DELETE FROM items WHERE id = $1` )
const ( LinkListQuery = `SELECT id, name, description, owner_id, location_id, destination_id, created, updated FROM links` LinkGetQuery = `SELECT id, name, description, owner_id, location_id, destination_id, created, updated FROM links WHERE id = $1` LinkCreateQuery = `INSERT INTO links (name, description, owner_id, location_id, destination_id) ` + `VALUES ($1, $2, $3, $4, $5) ` + `RETURNING id, name, description, owner_id, location_id, destination_id, created, updated` LinkUpdateQuery = `UPDATE links SET name = $2, description = $3, owner_id = $4, location_id = $5, destination_id = $6) ` + `WHERE id = $1 ` + `RETURNING id, name, description, owner_id, location_id, destination_id, created, updated` LinkRemoveQuery = `DELETE FROM links WHERE id = $1` )
const ( PlayerListQuery = `SELECT id, name, description, home_id, location_id, created, updated FROM players` PlayerGetQuery = `SELECT id, name, description, home_id, location_id, created, updated FROM players WHERE id = $1` PlayerCreateQuery = `INSERT INTO players (name, description, home_id, location_id) ` + `VALUES ($1, $2, $3, $4) ` + `RETURNING id, name, description, home_id, location_id, created, updated` PlayerUpdateQuery = `UPDATE players SET name = $2, description = $3, home_id = $4, location_id = $5 ` + `WHERE id = $1 ` + `RETURNING id, name, description, home_id, location_id, created, updated` PlayerRemoveQuery = `DELETE FROM players WHERE id = $1` )
const ( RoomListQuery = `SELECT id, name, description, owner_id, parent_id, created, updated FROM rooms` RoomGetQuery = `SELECT id, name, description, owner_id, parent_id, created, updated FROM rooms WHERE id = $1` RoomCreateQuery = `INSERT INTO rooms (name, description, owner_id, parent_id) ` + `VALUES ($1, $2, $3, $4) ` + `RETURNING id, name, description, owner_id, parent_id, created, updated` RoomUpdateQuery = `UPDATE rooms SET name = $2, description = $3, owner_id = $4, parent_id = $5 ` + `WHERE id = $1 ` + `RETURNING id, name, description, owner_id, parent_id, created, updated` RoomRemoveQuery = `DELETE FROM rooms WHERE id = $1` )
const ( UserListQuery = `SELECT id, login, public_key, player_id, created, updated FROM users` UserGetQuery = `SELECT id, login, public_key, player_id, created, updated FROM users WHERE id = $1` UserCreateQuery = `INSERT INTO users (login, public_key) ` + `VALUES ($1, $2) ` + `RETURNING id, login, public_key, player_id, created, updated` UserUpdateQuery = `UPDATE users SET login = $2, public_key = $3 ` + `WHERE id = $1 ` + `RETURNING id, login, public_key, player_id, created, updated` AssociatePlayerQuery = `UPDATE users SET player_id = $2 ` + `WHERE id = $1 ` + `RETURNING id, login, public_key, player_id, created, updated` UserRemoveQuery = `DELETE FROM users WHERE id = $1` )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver struct{}
func (Driver) IsForeignKeyViolation ¶
IsForeignKeyViolation returns true if the given error is a foreign key violation error.
func (Driver) IsUniqueViolation ¶
IsUniqueViolation returns true if the given error is a unique violation error.
type ItemDriver ¶
type ItemDriver struct {
Driver
}
func (ItemDriver) CreateQuery ¶
func (ItemDriver) CreateQuery() string
CreateQuery returns the Create query string.
func (ItemDriver) GetQuery ¶
func (ItemDriver) GetQuery() string
GetQuery returns the Get query string.
func (ItemDriver) ListQuery ¶
func (ItemDriver) ListQuery(filter asset.ItemFilter) string
ListQuery returns the List query string given the filter.
func (ItemDriver) RemoveQuery ¶
func (ItemDriver) RemoveQuery() string
RemoveQuery returns the Remove query string.
func (ItemDriver) UpdateQuery ¶
func (ItemDriver) UpdateQuery() string
UpdateQuery returns the Update query string.
type LinkDriver ¶
type LinkDriver struct {
Driver
}
func (LinkDriver) CreateQuery ¶
func (LinkDriver) CreateQuery() string
CreateQuery returns the Create query string.
func (LinkDriver) GetQuery ¶
func (LinkDriver) GetQuery() string
GetQuery returns the Get query string.
func (LinkDriver) ListQuery ¶
func (LinkDriver) ListQuery(filter asset.LinkFilter) string
ListQuery returns the List query string given the filter.
func (LinkDriver) RemoveQuery ¶
func (LinkDriver) RemoveQuery() string
RemoveQuery returns the Remove query string.
func (LinkDriver) UpdateQuery ¶
func (LinkDriver) UpdateQuery() string
UpdateQuery returns the Update query string.
type PlayerDriver ¶
type PlayerDriver struct {
Driver
}
func (PlayerDriver) CreateQuery ¶
func (PlayerDriver) CreateQuery() string
CreateQuery returns the Create query string.
func (PlayerDriver) GetQuery ¶
func (PlayerDriver) GetQuery() string
GetQuery returns the Get query string.
func (PlayerDriver) ListQuery ¶
func (PlayerDriver) ListQuery(filter asset.PlayerFilter) string
ListQuery returns the List query string given the filter.
func (PlayerDriver) RemoveQuery ¶
func (PlayerDriver) RemoveQuery() string
RemoveQuery returns the Remove query string.
func (PlayerDriver) UpdateQuery ¶
func (PlayerDriver) UpdateQuery() string
UpdateQuery returns the update query string.
type RoomDriver ¶
type RoomDriver struct {
Driver
}
func (RoomDriver) CreateQuery ¶
func (RoomDriver) CreateQuery() string
CreateQuery returns the Create query string.
func (RoomDriver) GetQuery ¶
func (RoomDriver) GetQuery() string
GetQuery returns the Get query string.
func (RoomDriver) ListQuery ¶
func (RoomDriver) ListQuery(filter asset.RoomFilter) string
ListQuery returns the List query string given the filter.
func (RoomDriver) RemoveQuery ¶
func (RoomDriver) RemoveQuery() string
RoomsRemoveQuery returns the Remove query string.
func (RoomDriver) UpdateQuery ¶
func (RoomDriver) UpdateQuery() string
UpdateQuery returns the Update query string.
type UserDriver ¶
type UserDriver struct {
Driver
}
func (UserDriver) AssociatePlayerQuery ¶ added in v0.2.8
func (UserDriver) AssociatePlayerQuery() string
AssociatePlayerQuery returns the AssociatePlayer query string.
func (UserDriver) CreateQuery ¶
func (UserDriver) CreateQuery() string
CreateQuery returns the Create query string.
func (UserDriver) GetQuery ¶
func (UserDriver) GetQuery() string
GetQuery returns the Get query string.
func (UserDriver) ListQuery ¶
func (UserDriver) ListQuery(filter user.Filter) string
ListQuery returns the List query string given the filter.
func (UserDriver) RemoveQuery ¶
func (UserDriver) RemoveQuery() string
RemoveQuery returns the Remove query string.
func (UserDriver) UpdateQuery ¶
func (UserDriver) UpdateQuery() string
UpdateQuery returns the Update query string.