cockroach

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlayersListQuery   = `SELECT player_id, name, description, home_id, location_id, created, updated FROM players`
	PlayersGetQuery    = `SELECT player_id, name, description, home_id, location_id, created, updated FROM players WHERE player_id = $1`
	PlayersCreateQuery = `INSERT INTO players (name, description, home_id, location_id) ` +
		`VALUES ($1, $2, $3, $4) ` +
		`RETURNING player_id, name, description, home_id, location_id, created, updated`
	PlayersUpdateQuery = `UPDATE players SET name = $2, description = $3, home_id = $4, location_id = $5, updated = now() ` +
		`WHERE player_id = $1 ` +
		`RETURNING player_id, name, description, home_id, location_id, created, updated`
	PlayersRemoveQuery = `DELETE FROM players WHERE player_id = $1`

	RoomsListQuery   = `SELECT room_id, name, description, owner_id, parent_id, created, updated FROM rooms`
	RoomsGetQuery    = `SELECT room_id, name, description, owner_id, parent_id, created, updated FROM rooms WHERE room_id = $1`
	RoomsCreateQuery = `INSERT INTO rooms (name, description, owner_id, parent_id) ` +
		`VALUES ($1, $2, $3, $4) ` +
		`RETURNING room_id, name, description, owner_id, parent_id, created, updated`
	RoomsUpdateQuery = `UPDATE rooms SET name = $2, description = $3, owner_id = $4, parent_id = $5, updated = now() ` +
		`WHERE room_id = $1 ` +
		`RETURNING room_id, name, description, owner_id, parent_id, created, updated`
	RoomsRemoveQuery = `DELETE FROM rooms WHERE room_id = $1`

	LinksListQuery   = `SELECT link_id, name, description, owner_id, location_id, destination_id, created, updated FROM links`
	LinksGetQuery    = `SELECT link_id, name, description, owner_id, location_id, destination_id, created, updated FROM links WHERE link_id = $1`
	LinksCreateQuery = `INSERT INTO links (name, description, owner_id, location_id, destination_id) ` +
		`VALUES ($1, $2, $3, $4, $5) ` +
		`RETURNING link_id, name, description, owner_id, location_id, destination_id, created, updated`
	LinksUpdateQuery = `UPDATE links SET name = $2, description = $3, owner_id = $4, location_id = $5, destination_id = $6,  updated = now() ` +
		`WHERE link_id = $1 ` +
		`RETURNING link_id, name, description, owner_id, location_id, destination_id, created, updated`
	LinksRemoveQuery = `DELETE FROM links WHERE link_id = $1`

	ItemsListQuery   = `SELECT item_id, name, description, owner_id, location_id, inventory_id, created, updated FROM items`
	ItemsGetQuery    = `SELECT item_id, name, description, owner_id, location_id, inventory_id, created, updated FROM items WHERE item_id = $1`
	ItemsCreateQuery = `INSERT INTO items (name, description, owner_id, location_id, inventory_id) ` +
		`VALUES ($1, $2, $3, $4, $5) ` +
		`RETURNING item_id, name, description, owner_id, location_id, inventory_id, created, updated`
	ItemsUpdateQuery = `UPDATE items SET name = $2, description = $3, owner_id = $4, location_id = $5, inventory_id = $6,  updated = now() ` +
		`WHERE item_id = $1 ` +
		`RETURNING item_id, name, description, owner_id, location_id, inventory_id, created, updated`
	ItemsRemoveQuery = `DELETE FROM items WHERE item_id = $1`
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

func (Driver) IsForeignKeyViolation

func (Driver) IsForeignKeyViolation(err error) bool

IsForeignKeyViolation returns true if the given error is a foreign key violation error.

func (Driver) IsUniqueViolation

func (Driver) IsUniqueViolation(err error) bool

IsUniqueViolation returns true if the given error is a unique violation error.

func (Driver) ItemsCreateQuery

func (Driver) ItemsCreateQuery() string

ItemsCreateQuery returns the Create query string.

func (Driver) ItemsGetQuery

func (Driver) ItemsGetQuery() string

ItemsGetQuery returns the Get query string.

func (Driver) ItemsListQuery

func (Driver) ItemsListQuery(arcade.ItemsFilter) string

ItemsListQuery returns the List query string given the filter.

func (Driver) ItemsRemoveQuery

func (Driver) ItemsRemoveQuery() string

ItemsRemoveQuery returns the Remove query string.

func (Driver) ItemsUpdateQuery

func (Driver) ItemsUpdateQuery() string

ItemsUpdateQuery returns the Update query string.

func (Driver) LinksCreateQuery

func (Driver) LinksCreateQuery() string

LinksCreateQuery returns the Create query string.

func (Driver) LinksGetQuery

func (Driver) LinksGetQuery() string

LinksGetQuery returns the Get query string.

func (Driver) LinksListQuery

func (Driver) LinksListQuery(arcade.LinksFilter) string

LinksListQuery returns the List query string given the filter.

func (Driver) LinksRemoveQuery

func (Driver) LinksRemoveQuery() string

LinksRemoveQuery returns the Remove query string.

func (Driver) LinksUpdateQuery

func (Driver) LinksUpdateQuery() string

LinksUpdateQuery returns the Update query string.

func (Driver) PlayersCreateQuery

func (Driver) PlayersCreateQuery() string

PlayersCreateQuery returns the Create query string.

func (Driver) PlayersGetQuery

func (Driver) PlayersGetQuery() string

PlayersGetQuery returns the Get query string.

func (Driver) PlayersListQuery

func (Driver) PlayersListQuery(filter arcade.PlayersFilter) string

PlayersListQuery returns the List query string given the filter.

func (Driver) PlayersRemoveQuery

func (Driver) PlayersRemoveQuery() string

PlayersRemoveQuery returns the Remove query string.

func (Driver) PlayersUpdateQuery

func (Driver) PlayersUpdateQuery() string

PlayersUpdateQuery returns the update query string.

func (Driver) RoomsCreateQuery

func (Driver) RoomsCreateQuery() string

RoomsCreateQuery returns the Create query string.

func (Driver) RoomsGetQuery

func (Driver) RoomsGetQuery() string

RoomsGetQuery returns the Get query string.

func (Driver) RoomsListQuery

func (Driver) RoomsListQuery(arcade.RoomsFilter) string

RoomListQuery returns the List query string given the filter.

func (Driver) RoomsRemoveQuery

func (Driver) RoomsRemoveQuery() string

RoomsRemoveQuery returns the Remove query string.

func (Driver) RoomsUpdateQuery

func (Driver) RoomsUpdateQuery() string

RoomsUpdateQuery returns the Update query string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL