Documentation ¶
Overview ¶
Package postgres provides a simple wrapper around 3rd party postgres client.
Index ¶
- func ConnectAndGetDB(t *testing.T, serverAddr string, extras map[string]interface{})
- func GetPGHandle(t *testing.T, serverAddr string) *sql.DB
- func RunAlterQuery(t *testing.T, extras map[string]interface{})
- func RunCreateQuery(t *testing.T, extras map[string]interface{})
- func RunDeleteQuery(t *testing.T, extras map[string]interface{})
- func RunDropQuery(t *testing.T, extras map[string]interface{})
- func RunInsertQuery(t *testing.T, id int64, extras map[string]interface{})
- func RunSelectQuery(t *testing.T, extras map[string]interface{})
- func RunServer(t testing.TB, serverAddr, serverPort string) error
- func RunUpdateQuery(t *testing.T, extras map[string]interface{})
- type DummyTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectAndGetDB ¶
ConnectAndGetDB initiates a connection to the database, get a handle on the test db, and register cleanup handlers for the test. Finally, it saves the db handle and task context in the provided extras map.
func GetPGHandle ¶
GetPGHandle returns a handle on the test Postgres DB. This does not initiate a connection
func RunAlterQuery ¶
RunAlterQuery runs ALTER query on the test DB.
func RunCreateQuery ¶
RunCreateQuery creates a new table.
func RunDeleteQuery ¶
RunDeleteQuery run a deletion query on the test DB.
func RunDropQuery ¶
RunDropQuery drops a table.
func RunInsertQuery ¶
RunInsertQuery inserts a new row in the table.
func RunSelectQuery ¶
RunSelectQuery runs a SELECT query on the test DB.
func RunUpdateQuery ¶
RunUpdateQuery runs an UPDATE query on the test DB.