Documentation ¶
Index ¶
- type PGClient
- func (c *PGClient) Connect(host string, port int, username, password string) (bool, error)
- func (c *PGClient) ConnectWithDB(host string, port int, username, password, dbName string) (bool, error)
- func (c *PGClient) ExecuteQuery(host string, port int, username, password, dbName, query string) (string, error)
- func (c *PGClient) IsPostgres(host string, port int) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PGClient ¶
type PGClient struct{}
PGClient is a client for Postgres database.
Internally client uses go-pg/pg driver.
func (*PGClient) Connect ¶
Connect connects to Postgres database using given credentials.
If connection is successful, it returns true. If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.
func (*PGClient) ConnectWithDB ¶
func (c *PGClient) ConnectWithDB(host string, port int, username, password, dbName string) (bool, error)
ConnectWithDB connects to Postgres database using given credentials and database name.
If connection is successful, it returns true. If connection is unsuccessful, it returns false and error.
The connection is closed after the function returns.
Click to show internal directories.
Click to hide internal directories.