Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopyFromSource ¶
type CopyFromSource interface { // Next returns true if there is another row and makes the next row data // available to Values(). When there are no more rows available or an error // has occurred it returns false. Next() bool // Values returns the values for the current row. Values() ([]interface{}, error) // Err returns any error that has been encountered by the CopyFromSource. If // this is not nil *Conn.CopyFrom will abort the copy. Err() error }
CopyFromSource is the interface used by *Conn.CopyFrom as the source for copy data.
func CopyFromRows ¶
func CopyFromRows(rows [][]interface{}) CopyFromSource
CopyFromRows returns a CopyFromSource interface over the provided rows slice making it usable by *Conn.CopyFrom.
type FieldDescription ¶
type Identifier ¶
type Identifier []string
Identifier a PostgreSQL identifier or name. Identifiers can be composed of multiple parts such as ["schema", "table"] or ["table", "column"].
type Mocker ¶
type Mocker interface { PGXer QueriesRun() []onedb.MethodsRun SaveMethodCall(name string, arguments []interface{}) VerifyNextCommand(t *testing.T, name string, expected ...interface{}) }
Mocker is the interface for mocking and includes all of the PGXer interface plus 3 methods to make testing easier
type Oid ¶
type Oid uint32
Oid (Object Identifier Type) is, according to https://www.postgresql.org/docs/current/static/datatype-oid.html, used internally by PostgreSQL as a primary key for various system tables. It is currently implemented as an unsigned four-byte integer. Its definition can be found in src/include/postgres_ext.h in the PostgreSQL sources.
type PGXQuerier ¶
type PGXer ¶
func NewPgx ¶
func NewPgx(server string, port uint16, username string, password string, database string) (PGXer, error)
NewPgx returns a PGX DBer instance from a set of parameters
func NewPgxFromURI ¶
NewPgxFromURI returns a PGX DBer instance from a connection URI
type Rower ¶
type Rower interface { AfterClose(f func(Rower)) // modified from pgxRower to use interface Close() error // modified from pgxRower to match database/sql Conn() *pgx.Conn Err() error Fatal(err error) FieldDescriptions() []FieldDescription Next() bool onedb.Scanner Values() ([]interface{}, error) Columns() ([]string, error) // added }
Rower is the public interface for all the capability found in a *pgx.Rows. Note that the Close method returns an error similar to how database/sql's rows Close returns and error